1、["1","2","3"].map(parseInt)
[1, NaN, NaN]
2、[typeof null, null instanceof Object]
["object", false]
3、[[3,2,1].reduce(Math.pow),[].reduce(Math.pow)]
VM199:1 Uncaught TypeError: Reduce of empty array with no initial value
at Array.reduce
4、var val = 'smtg';
console.log('Value is ' + (val === 'smtg') ? 'Something' : 'Nothing');
Something
5、var name = 'World!';
(function () {
if (typeof name === 'undefined') {
var name = 'Jack';
console.log('Goodbye ' + name);
} else {
console.log('Hello ' + name);
}
})();
Goodbye Jack