Class 1/18 Flashcards
What does the = (equals) operator do in JavaScript?
It assigns values
Which keyword is used to declare a variable in JavaScript?
var
Which characters is a JavaScript variable allowed to begin with?
$ and _
What are quotation marks used for in JavaScript?
Strings
What is the purpose of strings in JavaScript?
They are used for text values
What is the purpose of booleans in JavaScript?
Represented by true or false, data that can only have 1 of 2 values
What is the purpose of numbers in JavaScript?
Unsure
What does null mean in JavaScript?
Lack of any value, not undefined
What data types can object properties hold?
They can hold any data type
Describe the syntax (structure) of object-literals in JavaScript.
const person = {firstName:”John”, lastName:”Doe”, age:50, eyeColor:”blue”};
What is the principal use of arrays?
An array can hold many values under a single name, and you can access the values by referring to an index number.
Describe the syntax (structure) of array-literals in JavaScript.
const array_name = [item1, item2, …];
What number represents the first index of an array?
0
How can you access the last element of an array?
let fruit = fruits[fruits.length - 1];