07 Nov 2016
if (condition1) { block of code to be executed if condition1 is true } else if (condition2) { block of code to be executed if the condition1 is false and condition2 is true } else { block of code to be executed if the condition1 is false and condition2 is false }
扩展:如何判断一个字符串为空或者null
x = "" if (!x) { alert("string is empty"); }
conditionA && conditionBconditionA || conditionB(conditionA && conditionB) || conditionC