Arrays Flashcards

1
Q

toString()

A

returns a string with the toString method called on each element, separated by commas

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

concat(item1 [,item2, …])

A

returns a new array with the items added to it. works for single elements as well as other arrays

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

join(sep)

A

converts an array to a string, and delimits values with the sep param. if sep not specified, it will use empty string to delimit.

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

pop()

A

removes and returns the last value in the array

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

push(item1, [,item2 …])

A

appends items to the end of the array

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

shift()

A

removes and returns the first value in the array

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

unshift(item1 [,item 2, …])

A

inserts items at the start of the array

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

slice(start [, end])

A

returns a sub-array from index start to end. if end is not specified, the last index is the ‘end’

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

sort([cmpfn])

A

sorts the array using the given comparison function

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

splice(start, delcount, [, item1[, …]])

A

lets you modify an array by deleting a section and replacing it with more items

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

reverse()

A

reverses a given array

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