Array Method 2s Pt Flashcards

1
Q

from()

A

Create an array from any iterable object.

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

includes ()

A

Checks for specified value in an array, returns a boolean, case sensitive

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

indexOf()

A

returns the first index (position) of a specified value.

returns -1 if the value is not found.

starts at a specified index and searches from left to right.

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

isArray()

A

returns true if an object is an array, otherwise false

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

join()

A

returns an array as a string, does not change the original array.

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

keys()

A

returns an Array Iterator (loopable) object with the keys of an array

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

length

A

sets or returns the number of elements in an array.

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

lastIndexOf()

A

Returns the last index of a specified value

returns -1 if the value is not found.

starts at a specified index and searches from right to left.

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

map()

A

calls a function once for each element in an array and create a new array with the results

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

pop()

A

removes the last value of the array
changes the original array
returns the removed element

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

prototype

A

allows you to add new properties and methods to arrays.

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

push()

A

adds an element to the end of the array

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

reduce()

A

executes a reducer function for array element. (add & subtract)

returns a single value: the function’s accumulated result.

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

reduceRight()

A

executes a reducer function for each array element.

works from right to left.

returns a single value: the function’s accumulated result.

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

reverse()

A

reverses the order of the elements in an array.

overwrites the original array.

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

shift()

A

removes the first value in an array and assigns it to a variable

17
Q

slice()

A

returns selected elements in an array, as a new array.

selects from a given start, up to a (not inclusive) given end

18
Q

some()

A

checks if any array elements pass a test (provided as a function)

method executes the function once for each array element

If the function returns true, some() returns true and stops.
If the function returns false, some() returns false and stops.

19
Q

sort()

A

sorts the elements of an array in alphabetical and ascending order

overwrites the original array

20
Q

splice()

A

adds and/or removes array elements

overwrites the original array.

21
Q

toString()

A

returns a string with array values separated by commas

does not change the original array

22
Q

unshift()

A

adds an element to the front of an array

23
Q

valueOf()

A

returns the array itself, does not change the original array