I do not understand why the wedding method is not working for me I have an array that looks : (It really is big but I did not want to dislodge the page) {{"content": "panel", "icon": "panel"}, { "Content": "samples", "icon": "sample"}]; I want to say one item in the middle: var testNavItems = navItems.splice (1, 0, {"content": "new neo "," Icon ":" new app "}); Console.log (testNavItems); OR var testNavItems = navItems.push ({"Content": "new av", "icon": "new app"}); Console.log (testNavItems); I get an empty array, is it possible in JS? .push and .splice no new Do not array them, they modify the original array. Try console.log (navItems);
I want to say one item in the middle:
var testNavItems = navItems.splice (1, 0, {"content": "new neo "," Icon ":" new app "}); Console.log (testNavItems); OR var testNavItems = navItems.push ({"Content": "new av", "icon": "new app"}); Console.log (testNavItems); I get an empty array, is it possible in JS? .push and .splice no new Do not array them, they modify the original array. Try console.log (navItems);
OR
var testNavItems = navItems.push ({"Content": "new av", "icon": "new app"}); Console.log (testNavItems); I get an empty array, is it possible in JS? .push and .splice no new Do not array them, they modify the original array. Try console.log (navItems);
I get an empty array, is it possible in JS?
.push and .splice no new Do not array them, they modify the original array. Try console.log (navItems);
.splice no new Do not array them, they modify the original array. Try console.log (navItems);
Try
console.log (navItems);
No comments:
Post a Comment