Is there console method to see JavaScript arrays and sub arrays with - Microsoft Community
Internet Explorer / Internet Explorer 11 / Windows 7
example:
i have multidimensional array.
if someone's sum value greater 21, want remove it, , put @ end of array.
using console.log or console.dir shows items in sub arrays separated commas.
var arrnew = [["ben", sumben], ["amy", sumamy], ["sam", sumsam]];
// if someone's score on 21, move them back.
console.dir("arrnew before: " + arrnew);
formoving = arrnew.splice(0, 1);
console.dir("formoving: " + formoving);
arrnew.push(formoving);
console.dir("arrnew after: " + arrnew);
i thinking may not possible because because square brackets part of coding syntax. array data/values may not stored in memory brackets.
i put in breakpoint , used debugger tab view values including arrays brackets.
the chrome browser's developer's tools showed more information doing this. can break things down little bit more using chrome.
note: trying figure out why code showing sub array double brackets when ran code. because using push() instead of concat() add sub array end of array.
Internet Explorer / Internet Explorer 11 / Windows 7
Comments
Post a Comment