Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




JAVASCRIPT - ARRAY METHODS


Note : Click on each of the array methods, we have some cool example for each one.

Functions used in Arrays



Method Description
sort() Used to Sort the elements in the Array
reverse() Used to reverse the elements in the Array
push() Used to insert an element at the end of the Array
indexOf() Used to return the first occurrence of that element in the Array
lastIndexOf() Used to return the index of a specific element. Starts from backwards.
pop() Used to remove an element from the Array
slice() Used to pick a chunk of elements from the Array and create a new Array
splice() Used to add new items to the Array
shift() Used to remove first array element and shifts other elements to the left.
unshift() Used to add a new element at the beginning of the array and shifts other elements to the right.
join() Used to join all the elements of the Array into a String.
toString() Used to convert an Array into a String.
concat() Used to create a new array by concatenating two or more arrays.
copyWithin() Used to copy array elements and place it in some other location
entries() Used to return an Array iterator object with key and value pairs
every() Used to check if all the elements of the array satisfies a specific condition
some() Used to check if all the elements of the array satisfies a specific condition
filter() Used to create an array with those elements that satisfies a given condition
map() Used to create a new array with the results from the function called.
find() Used to return the first element of the array that satisfies a given condition
forEach() Used to call a function as many times as that of the Array elements
from() Used to return an Array from any object
isArray() Used to check if a variable is an Array or not
keys() Used to return the keys from an Array
reduce() Used to reduce the elements of the array to a singe value starting from left to right.
reduceRight() Used to reduce the elements of the array to a singe value starting from right to left.
fill() Used to fill the array locations with a specified value
valueOf() Used to return the Array as is.