📜

JavaScript: Array, String & Object Methods

102 cards · 🇺🇸 English

Built-in methods for working with arrays, strings, and objects.

Study all 102 cards for free

Flashcards, quizzes, pixel-art games and a daily review that remembers for you.

Study this deck free

Try the first 10 cards

1 / 10
Question

Array.push()

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Already have an account? Sign in

Cards

  1. 1Array.push()
    Adds one or more elements to the end of an array and returns the new length
  2. 2Array.pop()
    Removes and returns the last element from an array
  3. 3Array.shift()
    Removes and returns the first element from an array
  4. 4Array.unshift()
    Adds one or more elements to the beginning of an array and returns the new length
  5. 5Array.map()
    A new array containing the results of calling a function on every element
  6. 6Array.filter()
    A new array with all elements that pass the test function
  7. 7Array.reduce()
    Executes a reducer function on each element to reduce the array to a single value (left to right)
  8. 8Array.forEach()
    Executes a provided function once for each array element (no return value)
  9. 9Array.find()
    The first element that satisfies the test function, or undefined if none found
  10. 10Array.findIndex()
    The index of the first element that satisfies the test function, or -1 if none found
  11. 11Array.some()
    true if at least one element passes the test function, false otherwise
  12. 12Array.every()
    true if all elements pass the test function, false otherwise
  13. 13Array.includes()
    Checks if an array contains a specified value, returns boolean
  14. 14Array.indexOf()
    The first index at which a given element is found, or -1 if not present
  15. 15Array.lastIndexOf()
    The last index at which a given element is found, or -1 if not present
  16. 16Array.slice()
    Returns a shallow copy of a portion of an array into a new array (start, end)
  17. 17Array.splice()
    Changes array by removing, replacing, or adding elements in place
  18. 18Array.concat()
    Merges two or more arrays into a new array
  19. 19Array.join()
    Joins all array elements into a string, separated by a specified delimiter
  20. 20Array.reverse()
    Reverses the array in place (mutates original array)
  21. 21Array.sort()
    Sorts array elements in place and returns the sorted array
  22. 22Array.flat()
    Creates a new array with sub-array elements concatenated recursively up to specified depth
  23. 23Array.flatMap()
    Maps each element using a function, then flattens the result by one level
  24. 24Array.fill()
    Fills array elements from start to end index with a static value
  25. 25Array.copyWithin()
    Shallow copies part of array to another location in the same array
  26. 26Array.at()
    Returns the element at the given index (accepts negative integers)
  27. 27Array.entries()
    An iterator object containing key/value pairs for each index
  28. 28Array.keys()
    An iterator containing the keys (indices) of the array
  29. 29Array.values()
    An iterator containing the values of the array
  30. 30Array.reduceRight()
    Applies a reducer function from right to left to reduce array to single value

And 72 more cards. Study the whole deck free

Articles about this deck

More Programming decks

See all
Study all 102 cards free