流程控制
if判断
'use strict'; let age = 3; if (age<3){//第一个判断 alert("kuwa"); }else if(age=5){//第二个判断 alert("5"); } else{//否则 alert("hhh"); }
while循环,避免程序死循环
while(age<100){ age = age + 1; console.log(age); } do{ age = age + 1; console.log(age); }while(age<100);
for循环
for (let i = 0; i < 100; i++) { console.log(age); }
forEach循环
let arr = [16,46,14,43,78,9,40,11,4]; //函数 arr.forEach(function (value){ console.log(value); });
for...in
/* *for(Type str:el){} * */ //for(var index in object) for(let num in arr){ if (arr.hasOwnProperty(num)){ console.log("存在"); console.log(arr[num]); } }
我的一生
第1章-废物的一生
第50章-糟糕的婴儿
第300章-莫欺少年穷
第600章-莫欺中年穷
第1000章-莫欺老年穷
第1100章-不详的离去
第1101章-棺材板的震动
第1150章-盗墓贼的眼泪
第1200章-死者为大