4. Codecademy: Javascript Flashcards
1
Q
Syntax: arrays
A
var arrayName = [data, data, data];
2
Q
True or False: Variables (var) can store both numbers and strings.
A
True
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.
4
Q
What is 0-based indexing?
A
Counting starts from 0 instead of from 1
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')