In an array, this function is used to add or remove elements. This function is available in four different types, they are
1. Pop – It helps to remove the last element of an array.
2. Push – This function helps to add a new element at the end of an array.
3. Shift – this function helps to remove the element on the extreme left of an array.
4. Unshift – To add a new element at the start of an array, this function is used.
Posted Date:- 2021-09-05 20:50:07