switch 与if else 的区别和使用差别 while 与 for ****** key / property / attribute / variable

switch 关键特性是  1  key  === value  严格判断是否

            switch (key){

              case value:

                }

         2   switch 需要找到 break;时才会停止运行

if else  特性  1   if(表达式)

      2  表达式返回真就会执行自己的代码块,

 

 

 

 

while    

 

for    for ( var i  = 0 ; i < arrty.lenght ; i++)

 

break and continue

break 是停止整个循环

continue是跳出当前单个循环

 

key  /  property   /  attribute  /  variable   :属性

 

 

object  与 array    对比

共同点     

typeof obj ——>  object

typeof arr——>  object

 

posted @ 2022-08-17 14:15  lknmn  阅读(6)  评论(0)    收藏  举报