Javascript Array Functions Flashcards

(28 cards)

1
Q

Array.prototype.at()

A

Returns the array item at the given index. Accepts negative integers, which count back from the last item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Array.prototype.concat()

A

Returns a new array that is this array joined with other array(s) and/or value(s).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Array.prototype.copyWithin()

A

Copies a sequence of array elements within the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Array.prototype.entries()

A

Returns a new Array Iterator object that contains the key/value pairs for each index in the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Array.prototype.every()

A

Returns true if every element in this array satisfies the testing function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Array.prototype.fill()

A

Fills all the elements of an array from a start index to an end index with a static value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Array.prototype.filter()

A

Returns a new array containing all elements of the calling array for which the provided filtering function returns true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Array.prototype.find()

A

Returns the FIRST found element in the array, if some element in the array satisfies the testing function, or undefined if not found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Array.prototype.findIndex()

A

Returns the found index in the array, if an element in the array satisfies the testing function, or -1 if not found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Array.prototype.forEach()

A

Calls a function for each element in the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Array.prototype.includes()

A

Determines whether the array contains a value, returning true or false as appropriate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Array.prototype.indexOf()

A

Returns the first (least) index of an element within the array equal to an element, or -1 if none is found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Array.prototype.join()

A

Joins all elements of an array into a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Array.prototype.keys()

A

Returns a new Array Iterator that contains the keys for each index in the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Array.prototype.lastIndexOf()

A

Returns the last (greatest) index of an element within the array equal to an element, or -1 if none is found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Array.prototype.map()

A

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

17
Q

Array.prototype.pop()

A

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

18
Q

Array.prototype.push()

A

Adds one or more elements to the end of an array, and returns the new length of the array.

19
Q

Array.prototype.reduce()

A

Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.

20
Q

Array.prototype.reduceRight()

A

Apply a function against an accumulator> and each value of the array (from right-to-left) as to reduce it to a single value.

21
Q

Array.prototype.reverse()

A

Reverses the order of the elements of an array in place. (First becomes the last, last becomes first.)

22
Q

Array.prototype.shift()

A

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

23
Q

Array.prototype.slice()

A

Extracts a section of the calling array and returns a new array.

24
Q

Array.prototype.some()

A

Returns true if at least one element in this array satisfies the provided testing function.

25
Array.prototype.sort()
Sorts the elements of an array in place and returns the array.
26
Array.prototype.splice()
Adds and/or removes elements from an array.
27
Array.prototype.unshift()
Adds one or more elements to the front of an array, and returns the new length of the array.
28
Array.prototype.values()
Returns a new Array Iterator object that contains the values for each index in the array.