JavaScript Array Methods – Practical Use Cases + Gotchas
1. push() and pop()
These work at the end of the array and modify the original array.
Normal Use Case
push() – Adding a new item to a cart
Before:
let cart = ["Shoes", "T-shirt"];
cart.push("Watch")
blogs.arnabsamanta.in5 min read