单选题
- node 中的哪个模块被用来创建 web server?
http 模块 - 在node.js应用中,(var http = require(‘http’)) 可以正确获取http模块
- 哪个JavaScript 库不支持 Promise规范?
underscore
JavaScript 库支持 Promise规范的有:
co
bluebird
Q(Q.js) - 以下 JavaScript程序输出什么
var x ="undefined";
var y = "false";
var z = "";
function assert (xVar){
if (xVar)
console.log(true);
else
console.log(false);
}
assert(x);
assert(y);
assert(z);
答案为: true , true, false
- 下面的代码输出结构为
var foo =1;
function baidu(){
console.log(foo);
var foo=2;
console.log(foo);
}
baidu();
答案:undefined 2