现在的位置: 首页 > 综合 > 正文

写一段最短的代码,用上js所有关键字

2012年10月11日 ⁄ 综合 ⁄ 共 377字 ⁄ 字号 评论关闭
void function() {//abcd   
  do break;while(typeof delete this);  
  for(var a;;)  
  if (true)  with(null)  
  try{}catch(a){}finally{} else throw new 1;  
   
  switch(1 in 1 instanceof 1) {  
    case false:  
    default:  
  }  
  return;  
};  

改进版:

new function() {  
    do break;while(typeof delete this);  
    for(var a;void 0;)  
        continue  
    if (null)  
        with(0)  
    try{  
        switch(1 in 1 instanceof 1) {  
            case false:  
            default:throw true  
        }  
    }catch(a){}finally{}else return  // console.log("去掉注释可以运行到这里")  
};  

抱歉!评论已关闭.