If
最简单的条件判断是if语句,语法是 if(condition){ do this … } 。条件判断为真,才执行分支中的代码。举个字符串的例子:var country = 'France';var weather;var food;var currency;if(country === 'England') { weather = 'horrible'; food = 'filling'; currency = 'pound sterling';}if(country === 'France') { weather = 'nice';
Xebcnor