ExamAdda LogoExamAdda
CompilerDSA Animations
JAVASCRIPTMYSQL1MYSQLPYTHONINTERVIEWNODEJSDBMSDBMS1ROADMAPSDSA

Basic JavaScript

  • Basic
  • Syntax
  • Variables
  • Operators
  • Conditionals
  • Loops
  • Strings
  • Numbers
  • Functions
  • Objects
  • Scope
  • Dates
  • Sets
  • Maps
  • Iterations
  • Math
  • RegExp
  • Data Types
  • Arrays
    • Introduction to Arrays
    • Array Methods
    • Array Search
    • Array Sort
    • Array Iterations
    • Array Reference
    • Array Const
  • Errors
  • Events
  • References

JS Advanced

  • Asynchronous JS

JavaScript Array Reference

Last updated: Feb 14, 2026
Author :Kushagra YadavKushagra Yadav

The JavaScript Array reference provides a complete overview of array properties and methods used to store, access, search, transform, sort, and manage collections of data. Arrays are a core data structure in JavaScript and are used in almost every application.


What Is a JavaScript Array?

An array is an ordered list of values stored in a single variable.
Each value is called an element, and each element has an index starting from 0.

JavaScript
1let items = ["pen", "book", "eraser"];

Explanation:
Stores multiple related values in one variable.


Array Properties

length

Returns the total number of elements in the array.

JavaScript
1let items = ["pen", "book", "eraser"];
2console.log(items.length);

Explanation:
Returns 3 for three elements.


Creating Arrays

JavaScript
1let numbers = [10, 20, 30];

Explanation:
Creates an array with numeric values.


Accessing and Updating Elements

JavaScript
1let colors = ["red", "blue", "green"];
2colors[1] = "yellow";
3console.log(colors[1]);

Explanation:
Accesses and updates elements using index positions.


Common Array Methods (Reference)

Add / Remove

  • push() → add to end

  • pop() → remove from end

  • shift() → remove from start

  • unshift() → add to start

Search

  • includes() → check if value exists

  • indexOf() → find index

  • lastIndexOf() → find last index

  • find() → find element by condition

  • findIndex() → find index by condition

Iteration / Transformation

  • forEach() → loop through elements

  • map() → create new array

  • filter() → filter elements

  • reduce() → combine values

  • some() → check any match

  • every() → check all match

Sorting / Reordering

  • sort() → sort elements

  • reverse() → reverse array

Extract / Combine

  • slice() → extract portion

  • splice() → add/remove elements

  • concat() → merge arrays


Mutating vs Non-Mutating Methods

Some methods change the original array, others return a new array.

Mutating Methods:
push(), pop(), shift(), unshift(), sort(), splice(), reverse()

Non-Mutating Methods:
map(), filter(), slice(), concat(), includes()


Common Mistakes with Arrays

  • Forgetting that indexes start from 0

  • Mutating arrays unintentionally

  • Using map() when no new array is required

  • Confusing slice() with splice()


Summary of JavaScript Array Reference

CategoryMethods / Properties
Propertylength
Add/Removepush(), pop(), shift(), unshift()
Searchincludes(), indexOf(), find()
IterationforEach(), map(), filter(), reduce()
Sortingsort(), reverse()
Extract/Mergeslice(), splice(), concat()

Conclusion

The JavaScript Array reference provides essential methods and properties to manage collections of data effectively. By understanding how to create arrays, access elements, and use built-in methods for searching, iterating, sorting, and transforming data, array handling becomes simple and powerful in JavaScript applications.


Previous Tutorial
Array Iterations
Next Tutorial
Array Const
ExamAdda LogoExamAdda Tech

Your comprehensive destination for learning programming, web development, data science, and modern technologies. Master coding with our in-depth tutorials and practical examples.

Support

  • About Us
  • Contact Us
  • Privacy Policy
  • Terms of Service

Connect With Us

Follow us on social media for the latest tutorials, tips, and programming updates.

© 2026 ExamAdda Tech. All rights reserved.

Privacy PolicyTerms of ServiceCookie Policy