Skip to content

mdammadali/learn-js-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

JavaScript Array Methods

  • at();
  • concat();
  • copyWithin();
  • entries();
  • every();
  • fill();
  • filter();
  • find();
  • findIndex();
  • findLast();
  • findLastIndex();
  • flat();
  • flatMap();
  • forEach();
  • includes();
  • indexOf();
  • join();
  • keys();
  • lastIndexOf();
  • length();
  • map();
  • pop();
  • push();
  • reduce();
  • reduceRight();
  • reverse();
  • shift();
  • slice();
  • some();
  • sort();
  • splice();
  • toLocaleString();
  • toReversed()
  • toSorted();
  • toSpliced();
  • toString();
  • unshift();
  • values();
  • with();

1. CREATE (Add Data)

  • push()
  • unshift()
  • concat()
  • splice()

2. READ (Access Data)

  • at() – Access by index (supports negative index)
  • length – Get array length
  • includes() – Check if value exists
  • indexOf() / lastIndexOf() – Find index
  • find() – First match by condition
  • findIndex() – Index of first match
  • findLast() – Last match by condition
  • findLastIndex() – Last matching index
  • some() – At least one matches
  • some() – At least one matches
  • entries() – Get index + value iterator
  • keys() – Get index iterator
  • values() – Get value iterator

3. UPDATE (Modify Data)

  • splice() – Replace elements
  • with() – Replace by index (immutable)

4. DELETE (Remove Data)

  • pop() – Remove last
  • shift() – Remove first
  • splice() – Remove by index
  • filter() – Remove by
  • fill() – Fill with value
  • copyWithin() – Copy part of array
  • reverse() – Reverse in place
  • sort() – Sort in place
  • map() – Transform values (returns new array)
  • flat() – Flatten nested arrays
  • flatMap() – Map + flatten
  • reduce() – Reduce to single value
  • reduceRight() – Reduce from right
  • forEach() – Loop (no return)

5. IMMUTABLE (Modern Non-Mutating Methods)

  • toReversed()
  • toSorted()
  • toSpliced()
  • with()

6. CONVERSION METHODS

  • join()
  • toString()
  • toLocaleString()

About

JS array methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors