Education logo

28 Javascript Array Methods: A Cheat Sheet for Developer

Javascript Array Methods: A Cheat Sheet for Developer

By Rahul SharmaPublished 3 years ago β€’ 3 min read
28 Javascript Array Methods: A Cheat Sheet for Developer

Array.map()

Returns a new array with the results of calling a provided function on every element in this array.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.filter()

Returns a new array with all elements that pass the test implemented by the provided function.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.reduce()

Reduce the array to a single value. The value returned by the function is stored in an accumulator (result/total).

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.reduceRight()

Executes a reducer function (that you provide) on each element of the array resulting in a single output value(from right to left).

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.fill()

Fill the elements in an array with a static value.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.find()

Returns the value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.indexOf()

Returns the first index at which a given element can be found in the array, or -1 if it is not present.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.lastIndexOf()

Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backward, starting at fromIndex.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.findIndex()

Returns the index of the first element in the array that satisfies the provided testing function. Otherwise, -1 is returned.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.includes()

Returns true if the given element is present in the array.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.pop()

Removes the last element from an array and returns that element.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.push()

Appends new elements to the end of an array, and returns the new length.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.shift()

Removes the first element from an array and returns that element.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.unshift()

Adds new elements to the beginning of an array, and returns the new length.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.splice()

Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.slice()

Returns a shallow copy of a portion of an array into a new array object selected from beginning to end (end not included). The original array will not be modified.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.join()

Joins all elements of an array into a string.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.reverse()

Reverses the order of the elements in an array.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.sort()

Sorts the elements of an array in place and returns the array. The default sort order is according to string Unicode code points.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.some()

Returns true if at least one element in the array passes the test implemented by the provided function.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.every()

Returns true if all elements in the array pass the test implemented by the provided function.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.from()

Creates a new array from an array-like or iterable object.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.of()

Creates a new array with a variable number of arguments, regardless of the number or type of the arguments.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.isArray()

Returns true if the given value is an array.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.at()

Returns a value at the specified index.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.copyWithin()

Copies array elements within the array. Returns the modified array.

28 Javascript Array Methods: A Cheat Sheet for Developer

NOTE: πŸ€”

  • the first argument is the target from which to start copying elements.
  • the second argument is the index at which to start copying elements.
  • the third argument is the index at which to stop copying elements.

Array.flat()

Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

28 Javascript Array Methods: A Cheat Sheet for Developer

Array.flatMap()

Returns a new array formed by applying a given callback function to each element of the array,

28 Javascript Array Methods: A Cheat Sheet for Developer

Thank you for taking the time to read. If you have any questions or comments, please feel free to leave them below. We would love to hear your thoughts on this topic and help you in any way we can. Let's continue the conversation!

Catch me on YouTube, Github, Twitter, LinkedIn, Medium, Stackblitz, and Dev.to. I share content related to these topics, including tutorials, articles, and code samples. Don't hesitate to follow or reach out to me on any of these platforms if you have any questions or want to connect.

collegecoursesdegreeinterviewstudentteacherhow to

About the Creator

Rahul Sharma

I'm a technology enthusiast who does web development. Passionate to contribute to open-source projects and making cool products.

βœ” I’m currently learning about Flutter

βœ” Ask me anything you want, If I'm alive I will answer within seconds πŸ˜‰

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    Β© 2026 Creatd, Inc. All Rights Reserved.