你感觉自己是JSer?来看看下面的测试……是男人就挨个琢磨,不许一顿滚动条!


  1. 1 && 3

  2. 1 && "foo" || 0

  3. 1 || "foo" && 0

  4. (1,2,3)

  5. x = {shift:[].shift};
    x.shift();
    x.length;

  6. {foo:1}[0]

  7. [true, false][+true, +false]

  8. ++'52'.split('')[0]

  9. a: b: c: d: e: f: g: 1, 2, 3, 4, 5;

  10. {a: 1, b: 2}[["b"]]

  11. "b" + 45

  12. {a:{b:2}}

  13. (function(){}())

  14. [1,2,3,4,5][0..toString.length]

  15. ({} + 'b' > {} + 'a')

  16. Number.prototype.x = function(){ return this === 123; };
    (123).x();

  17. Array(2).join()

  18. vars: var vars = vars;

  19. { foo = 123 }

  20. x = 1; (function(){return x; var x = 2;}())

  21. delete [].length;

  22. RegExp.prototype.toString = function() {return this.source};/3/-/2/;

  23. {break;4;}

  24. 'foo' == new function(){ return String('foo'); };

  25. 'foo'.split('') + []

 

PS:以上问题来自一篇老外的文章,答案为我的翻译+理解,若有错误,请有节操的高端人士劈头盖脸的指正……)

 

 

相关文章:

  • 2021-07-02
  • 2021-07-19
  • 2021-07-20
  • 2021-11-19
  • 2022-12-23
  • 2021-07-22
  • 2021-04-12
  • 2021-04-16
猜你喜欢
  • 2021-04-06
  • 2021-11-28
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-06-11
  • 2021-05-25
相关资源
相似解决方案