can any one help me out with this two in methods javaScript
a
is resulting as [0,NaN,0,0,0]
and b
is resulting as [0,0,0,0,0]
why a is having NaN
in a
array?
var a =new Array(5).fill('0').map(parseInt);
console.log(a);
var b =new Array(5).fill('0').map(parseFloat);
console.log(b);