JS 4.4 Arrays Flashcards

1
Q

Define ( Arrays )

A

Arrays are generally describe as “list-like” single objects that contain multiple values stored in a list.

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

How does multidimensional arrays work?

A

By chaining two square brackets together, the first bracket will select the array and the second will be used to select the index desired

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

Define the .push() method

A

This method adds one or more values to the end of an Array and RETURNS the new length

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

Define the .unshift() method

A

This method adds one or more values to the beginning of an array and RETURNS the new length

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

What does this ( .length) property return to us when used on an variable containing an Array?

A

The amount of ‘items’ stored within the Array

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

Define the .pop() method

A

This method removes the LAST element from the end of the list and returns the new length

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

Define the .shift() method

A

This method removes the FIRST element from the end of the list and returns the new length

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

The pop & shift method doesn’t just remove the last and first element it also ___

A

Returns the last element or first element

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

Define the ( Spread ) syntax and use

A

The spread syntax ( … ) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments or elements are expected.

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

Define the Math.max( ) and Math.min( ) functions

A

These functions return the largest or smallest of the zero or more numbers given as input parameters, or NaN if any parameter isn’t a number and can’t be converted into one. *HAS TO BE A NUMBER VALUE or spread.

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

Define the ( join( ) ) method

A

The join( ) method creates and returns a new string by concatenating all of the elements in an array

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

Define the ( includes( ) ) method

A

The includes( ) method determines whether an array includes a certain value among its entries, returning TRUE or FALSE

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

Define the ( indexOf( ) ) method

A

The indexOf( ) method returns the first index at which a given element can be found in the array, or -1 if it is not present

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