How to Add Value to an Existing Array in JavaScript
In this lesson, we will see how to add value to an existing array in JavaScript, sometimes we want to add value to an existing array so how we can do that?
The push() method
To do that we can use the push() method that adds new values to the end of an existing array and returns the new length of the array.
const colors = ["blue", "orange", "black", "red"];
colors.push("yellow");
//5