1、判断:
在if判断中0,false,空串,undefined,null转换成false.其他的全部转换成true。
2、三元表达式:(三目运算、三元运算)if的简化版
语法:表达式1?表达式2:表达式3;
条件(boolean)
true的时候走表达式2
false的时候走表达式3
3、循环:在条件范围内.重复去执行某一段代码
for,for in,foreach,forof,while,dowhile
break;退出循环
continue;跳出本次循环
4、函数:封装代码,是一系列代码的集合
函数名:命名规则和变量的命名规则一样
参数:形参(形式上的参数),参数的类型可以不限,个数可以不限。
函数体:当函数被调用的时候所执行的代码
return:返回值,如果没有写,则返回underfined.