Code: Select all
function Calc(val,str, cmd,stack)
{
console.log(str, cmd, stack); // str and cmd shold have the same content, cmd is an array built from str
while(c = cmd.pop()) // *** MAYBE THIS IS THE OFFENDING LINE
{
if (c=='0') stack.push(val);
}
}
var k=2,i,s;
for (i=1;s=i.toString(6), !s[k]; i++)
{
Calc(1,s, s.split(''), []) // here I build a new array splitting a string
}
It logs 55 calls in console. After a few, the array is empty and does not resemble the string from which it should derive. I tried with firebug console and firefox web console or the developer console.
This code work flawlessly in Chrome and MSIE10