1. 程式人生 > >呼叫匿名函式的騷操作

呼叫匿名函式的騷操作

問:如何將1輸出: function(){console.log(1)}()
答:

  • (function(){console.log(1)}())
  • 1,function(){console.log(1)}()
  • +function(){console.log(1)}()
  • -function(){console.log(1)}()
  • ~function(){console.log(1)}()
  • !function(){console.log(1)}()
  • new function(){console.log(1)}()
  • 0function(){console.log(1)}()