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中label及加上属性for之后的用法
    Django中利用filter与simple_tag为前端自定义函数的实现方法
    关于自动编译iOS工程,生成app及ipa文件的方法-备
    ios打包ipa的四种实用方法(.app转.ipa)-备
    为GCD队列绑定NSObject类型上下文数据-利用__bridge_retained(transfer)转移内存管理权-备
    GCD使用经验与技巧浅谈--备
    h5与iOS的wkwebview不兼容问题
    cocoaPods 安装和应用
    .a静态库的注意事项
    UIApplication详解再解-备
  • 原文地址:https://www.cnblogs.com/ccto/p/3013525.html
Copyright © 2011-2022 走看看