寫一段最短的代碼,用上js所有關鍵字


群里的題目:

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("去掉注釋可以運行到這里")
            };


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM