烧脑细胞时间,请分别说明下述代码的输出。
代码一
var hello = new function() {
return "hello, world!"
};
alert(hello);代码二
function hello() {
return "hello, world!";
}
var hello_sample = new hello();
alert(hello_sample);代码三
var hello = new function() {
return new String("hello, world!")
};
alert(hello);代码四
var hello = new function() {
return function() {
return 'hello, world!';
};
};
alert(hello);代码五
var hello = function() {return "hello, world!"}();
alert(hello);可以参考 怿飞 Blog 上的 一篇文章 。







