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

2015-07-01 15:47:18 +08:00
 cauil
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;
3824 次点击
所在节点    JavaScript
17 条回复
zhujinliang
2015-07-01 16:31:00 +08:00
chrome console加google终于弄明白了。。。感谢楼主分享
hahasong
2015-07-01 16:34:47 +08:00
反对任何滥用语言的灵活性,生产环境写这种东西真的是作死
101
2015-07-01 16:36:10 +08:00
第六题还能这么玩......
mhycy
2015-07-01 16:41:42 +08:00
这种应试题有什么意义么?
shreksu
2015-07-01 16:47:11 +08:00
然并卵
latelx
2015-07-01 16:47:54 +08:00
格式太差。。。。
datou552211
2015-07-01 16:59:38 +08:00
会写二叉树嘛
snailsir
2015-07-01 17:01:14 +08:00
有没有专业六级的
newghost
2015-07-01 17:13:24 +08:00
snailsir
2015-07-01 18:52:15 +08:00
@newghost 跪了
bramblex
2015-07-01 20:26:40 +08:00
楼主把下面这段JavaScript代码解释一遍再说吧:

[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()
Threezj
2015-07-01 20:44:53 +08:00
反转二叉树。。
nekoyaki
2015-07-02 09:52:03 +08:00
想起了之前姬友拿来问我的一道题,好象是给了个i的初始值,问i+++i+++i返回值多少,i是多少……
然后标准答案里大谈特谈分析了一通给了一个答案,然后我淡定地扔到gcc和VC6.0和VS里一编译,给的结果都不一样……
ahnujyyang
2015-07-02 12:05:46 +08:00
@hahasong 同意, 纯粹嘬死
irainy
2015-07-05 23:27:26 +08:00
把有限的生命投入到无限的brain f**k中~
shyscool
2015-07-06 15:09:28 +08:00
TUT
mingyun
2015-07-12 20:34:48 +08:00
工作中不会这样写吧

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/202510

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX