zoukankan      html  css  js  c++  java
  • 【你敢说你懂JS吗】——JS测试

    你感觉自己是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('') + []

  • 相关阅读:
    在HTML中使用css3实现雪人动画效果
    不一样的函数防抖和节流
    2020全球C++及系统软件技术大会成功落下帷幕
    详解flex布局做骰子案例
    LeetCode-环形链表|+环形链表||
    03:成绩排序
    02:奇数单增序列
    谁考了第k名
    【23.59%】【hdu 5883】The Best Path
    【30.53%】【hdu 5878】I Count Two Three
  • 原文地址:https://www.cnblogs.com/ccto/p/3013525.html
Copyright © 2011-2022 走看看