V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
cauil
V2EX  ›  JavaScript

JAVASCRIPT 专业四级:这几个问题,你会做几个?

  •  
  •   cauil · 2015-07-01 15:47:18 +08:00 · 3798 次点击
    这是一个创建于 3434 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1. "1" - - "1";
    2. new Array(5).toString();
    3.
    var x = 0;
    function foo() {
    x++;
    this.x = x;
    return foo;
    }
    var bar = new new foo;
    console.log(bar.x);
    4.
    var bar = 1,
    foo = {};

    foo: {
    bar: 2;
    baz: ++bar;
    };
    foo.baz + foo.bar + bar;
    5.
    function foo(a, b) {
    arguments[1] = 2;
    console.log(b);
    }
    foo(1);
    6. (true + false) > 2 + true;
    17 条回复    2015-07-12 20:34:48 +08:00
    zhujinliang
        1
    zhujinliang  
       2015-07-01 16:31:00 +08:00
    chrome console加google终于弄明白了。。。感谢楼主分享
    hahasong
        2
    hahasong  
       2015-07-01 16:34:47 +08:00   ❤️ 1
    反对任何滥用语言的灵活性,生产环境写这种东西真的是作死
    101
        3
    101  
       2015-07-01 16:36:10 +08:00
    第六题还能这么玩......
    mhycy
        4
    mhycy  
       2015-07-01 16:41:42 +08:00
    这种应试题有什么意义么?
    shreksu
        5
    shreksu  
       2015-07-01 16:47:11 +08:00   ❤️ 2
    然并卵
    latelx
        6
    latelx  
       2015-07-01 16:47:54 +08:00
    格式太差。。。。
    datou552211
        7
    datou552211  
       2015-07-01 16:59:38 +08:00 via iPhone
    会写二叉树嘛
    snailsir
        8
    snailsir  
       2015-07-01 17:01:14 +08:00
    有没有专业六级的
    newghost
        9
    newghost  
       2015-07-01 17:13:24 +08:00
    snailsir
        10
    snailsir  
       2015-07-01 18:52:15 +08:00
    @newghost 跪了
    bramblex
        11
    bramblex  
       2015-07-01 20:26:40 +08:00
    楼主把下面这段JavaScript代码解释一遍再说吧:

    [][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()
    Threezj
        12
    Threezj  
       2015-07-01 20:44:53 +08:00
    反转二叉树。。
    nekoyaki
        13
    nekoyaki  
       2015-07-02 09:52:03 +08:00
    想起了之前姬友拿来问我的一道题,好象是给了个i的初始值,问i+++i+++i返回值多少,i是多少……
    然后标准答案里大谈特谈分析了一通给了一个答案,然后我淡定地扔到gcc和VC6.0和VS里一编译,给的结果都不一样……
    ahnujyyang
        14
    ahnujyyang  
       2015-07-02 12:05:46 +08:00
    @hahasong 同意, 纯粹嘬死
    irainy
        15
    irainy  
       2015-07-05 23:27:26 +08:00
    把有限的生命投入到无限的brain f**k中~
    shyscool
        16
    shyscool  
       2015-07-06 15:09:28 +08:00 via Android
    TUT
    mingyun
        17
    mingyun  
       2015-07-12 20:34:48 +08:00
    工作中不会这样写吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2858 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:34 · PVG 20:34 · LAX 04:34 · JFK 07:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.