Multiple choice
- Which module in node is used to create the web server?
http module - In the node.js application, (var http = require('http')) can obtain the http module correctly
- Which JavaScript library does not support the Promise specification?
The underscore
JavaScript library supports the Promise specification:
co
bluebird
Q(Q.js) - What does the following JavaScript program output
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);
The answer is: true, true, false
- The following code output structure is
var foo =1;
function baidu(){
console.log(foo);
var foo=2;
console.log(foo);
}
baidu();
Answer: undefined 2