How to use push array method?

This is tutorial on how to use push array method in Javascript.

const numbers = [1,2,3];
To add a number use push method like this.
To add another one you can use another one.
Also you can use push method with multiple parameters.
You can store that in a variable.
const length = numbers.push(8);
Print it out to see.
console.log("Length is: " + length);

javascript push array

Leave a Reply

Your email address will not be published. Required fields are marked *