Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

JavaScript Basic

JS HOME JS Introduction JS Where To JS Output JS Syntax JS Statements JS Comments JS Variables JS Data Types JS Let JS Const JS Operators JS Arithmetic JS Assignment JS Functions JS Objects JS Events JS Strings JS String Templates JS Numbers JS Arrays JS Dates JS Math JS Booleans JS Comparisons JS Logical JS If Else JS Switch JS Loops JS Break JS Continue JS Errors JS Scope JS Code Blocks JS UTF-8 Characters

JS Advanced

JS Versions JS Statements JS Data Types JS String Methods JS Number Methods JS Date Formats JS Array Methods JS Functions JS Objects JS Classes JS Sets JS Maps JS Loops JS RegExp JS Callbacks JS Strict Mode JS DOM JS Window JS Web API JS AJAX JS JSON JS jQuery JS Graphics JS Examples

JS References

JavaScript Objects


JavaScript Array Reference


Complete Array Reference

Revised July 2025

Name Description
[ ] Creates a new Array
new Array() Creates a new Array
at() Returns an indexed element of an array
concat() Joins arrays and returns an array with the joined arrays
constructor Returns the function that created the Array prototype
copyWithin() Copies array elements within the array, to and from specified positions
entries() Returns a key/value pair Array Iteration Object
every() Checks if every element in an array pass a test
fill() Fill the elements in an array with a static value
filter() Creates a new array with every element in an array that pass a test
find() Returns the value of the first element in an array that pass a test
findIndex() Returns the index of the first element in an array that pass a test
findLast() Returns the value of the last element in an array that pass a test
findLastIndex() Returns the index of the last element in an array that pass a test
flat() Concatenates sub-array elements
flatMap() Maps all array elements and creates a new flat array
forEach() Calls a function for each array element
from() Creates an array from an object
includes() Check if an array contains the specified element
indexOf() Search the array for an element and returns its position
isArray() Checks whether an object is an array
join() Joins all elements of an array into a string
keys() Returns a Array Iteration Object, containing the keys of the original array
lastIndexOf() Search the array for an element, starting at the end, and returns its position
length Sets or returns the number of elements in an array
map() Creates a new array with the result of calling a function for each array element
of() Creates an array from a number of arguments
pop() Removes the last element of an array, and returns that element
prototype Allows you to add properties and methods to an Array object
push() Adds new elements to the end of an array, and returns the new length
reduce() Reduce the values of an array to a single value (going left-to-right)
reduceRight() Reduce the values of an array to a single value (going right-to-left)
reverse() Reverses the order of the elements in an array
shift() Removes the first element of an array, and returns that element
slice() Selects a part of an array, and returns the new array
some() Checks if any of the elements in an array pass a test
sort() Sorts the elements of an array
splice() Adds or Removes array elements
toReversed() Reverses the order of array elements (to a new array)
toSorted() Sorts the elements of an array (to a new array)
toSpliced() Adds or Removes array elements (to a new array)
toString() Converts an array to a string, and returns the result
unshift() Adds new elements to the beginning of an array, and returns the new length
valueOf() Returns the primitive value of an array
with() Returns a new array with updated elements

Complete JavaScript Reference

For a complete reference to all JavaScript properties and methods, with full descriptions and many examples, go to:

W3Schools' Full JavaScript Reference.

The reference inludes all JavaScript updates from 1999 to 2025.


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.