Important Function in javaScript array
- length
The javascript array length function returns the number of elements in an array. If there are no elements in the array length function return 0.
2. push
The push function adds a new item to the end array.
3. pop
The pop function removes the last item in an array.
4. shift
The shift function removers the first item in an array.
5. unshift
The unshift function adds the first item in an array.
6. indexOf
The indexOf function returns the index number.
7.sort
The sort function sorting the items.
8. splice
The slice function receives two parameters that remove items from the first parameter to the second parameter.
9.revers
The reverse function reverses an array of items.
10. isArray
The isArray function returns true or false if check the variable are array return true other always return false.
Thank you for reading…:)