4. Codecademy: Javascript Flashcards

1
Q

Syntax: arrays

A

var arrayName = [data, data, data];

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

True or False: Variables (var) can store both numbers and strings.

A

True

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

What is an array?

A

A 0-indexed data structure that stores lists of data, can store different date types and the same time, and are ordered so the position of each piece of data is fixed.

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

What is 0-based indexing?

A

Counting starts from 0 instead of from 1

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

True or false:

You can treat a string like an array of characters.

A

True

(e.g., var myArray = [‘hello’, ‘world’]; myArray[0]; // equals ‘hello’

var myName = 'Chloe';
myName[0];     // equals 'C')
How well did you know this?
1
Not at all
2
3
4
5
Perfectly