Trying to run a simple javascript to parse single digit ints in a string as follows:
var s = "22123222222213123212322123213222";
var a = s.split("");
var b = a.map(parseInt);
console.log(b);
[2, NaN, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 2, 2, 1, 2, 3, 2, 1, 3, 2, 2, 2]
Why is there a NaN for element with index 1?
Fiddle in the console here: https://jsfiddle.net/po6oy1ws/
EDIT
After getting the correct answer below I felt I had to lookup this "map(Number)" business. Turns out Mozilla has a "gotcha" clause concerning this specific case. Mozilla gotcha case