Can anyone please explain this to me? I am running the following code with the following input:
var results = [];
var tokenRegExp = /\s*([A-Za-z]+|[0-9]+|\S)\s*/g;
var m;
while ((m = tokenRegExp.exec(code)) !== null) {
results.push(m[1].toString() //I added the toString to see if it would change anything, it did absolutely nothing. I was running it without before that);
}
return results;
The input of "code" is 3+3+6*6*5*8/9-6
And then I am seeing this extremely strange behavior in the console... where the output array appears to be correct until you expand it
Thanks....