Answers for "how to append item to an array in foreach javascript"

0

how to append item to an array in foreach javascript

for (var i = 0; i < a.length; i++) {
    if (a[i] == 1) a.push(5);
    console.log(a[i]);
}
Posted by: Guest on December-29-2020

Code answers related to "how to append item to an array in foreach javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language