JavaScript - Arrays Flashcards

1
Q

What is an array?

A

An array is a data structure that stores a collection of items in a single variable.

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

What is a function?

A

Functions are blocks of code that help organise and reuse code efficiently. A function is a reusable piece of code that performs a specific task.

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

How many main array methods are there?

A

There are 4 Main Array Methods.

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

What are the names of the 4 Array Methods?

A

Pop, Push, Shift and Unshift.

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

What is an array method?

A

An array method is a function that is associated with an object or class in programming.

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

What does the push array method do?

A

The push method adds one or more elements to the end of an array.

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

What does the pop array method do?

A

The pop method removes the last element from an array and returns that element.

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

What does the push array method do?

A

The push method adds one or more elements to the end of an array.

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

What does the shift array method do?

A

The shift method removes the first element from an array and returns that element.

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

What does the unshift array method do?

A

The unshift method allows you to add one or more elements to the beginning of an array.

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

Which 2 Array Methods can you add/remove more than one of?

A

Push and Unshift

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