- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Array push and pop
JavaScript Arrays
JavaScript Array push and pop
JavaScript
push,pop,shiftandunshiftadd and remove elements at the ends of an array.
push and pop work at the end of the array.
unshift and shift work at the start.
Example
Example
javascript
const fruits = ["Apple"];
fruits.push("Banana");
console.log(fruits.join(","));The output is Apple,Banana.
