Javascript - Storing Data in Lists/Arrays Flashcards

1
Q

What are lists called in JavaScript?

A

Arrays

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

What do arrays in JavaScript store?

A

Multiple values in a single variable

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

What types of data can JavaScript arrays hold?

A

Any data type, including numbers, strings, objects, and even other arrays

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

How can you create an array in JavaScript?

A

Using square brackets [] or the Array constructor

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

Fill in the blank: You can create an array using _______ or the Array constructor.

A

[square brackets]

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

Provide an example of creating an array using square brackets.

A

let fruits = [“apple”, “banana”, “cherry”]

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

Provide an example of creating an array using the Array constructor.

A

let numbers = new Array(1, 2, 3, 4, 5)

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