Introduction
What is the output of the following code?
console.log(Number(1));
console.log(Number("1"));
console.log(Number("foo"));
console.log(Number(undefined));
console.log(Number(null));
console.log(Number(false));
console.log(Number(true));
1
1
NaN
NaN
0
0
1
PreviousNextRelated