Array Methods You Must Know
push() and pop()
push()
It is used to add a new element in array
code -
const arr = [1, 2, 3, 4, 5]
console.log(arr)
arr.push(6)
console.log(arr)
output -
[ 1, 2, 3, 4, 5 ]
[ 1, 2, 3, 4, 5, 6 ]
pop
skullcoder.hashnode.dev5 min read