📜  javascript 跳出循环 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:23.860000             🧑  作者: Mango

代码示例2
By using 'return;':

function myfunction(){
   if(a == 'stop') 
      return;  //returns Void, ending function
}

Does not work when using a Conditional operator:

let result =  1 == 2   ?  "YES" : return;  //<--- throws error