In Javascript, we can easily push elements into an array and pop elements out of an array with a single function. These actions can be performed by using the push() and pop() functions respectively.
Syntax : original_array.push("value1"); original_array.pop();
original_array.push("value1");
original_array.pop();
Push my name! Pop a name! let arr = ["Roger", "Patrick", "Teresa"]; arr.push("< value from input box >"); arr = ??
let arr = ["Roger", "Patrick", "Teresa"]; arr.push("< value from input box >");
let arr = [1.3, 4.5, 6.5]; arr.pop(); Pop the next element! arr = ??
let arr = [1.3, 4.5, 6.5]; arr.pop();