Javascript-primitives & variables Flashcards
What is the purpose of variables?
Store Data
how do you declare a variable?
var (keyword) _____(variable name);
How do you initialize (assign a value to) a variable?
assign operations
What characters are allowed in variable names?
letters, $
What is the purpose of a string?
any type of text
What is the purpose of a number?
is a primitive warpper object used to represent & manipulate numbers
What is the purpose of a boolean?
only gives 2 values, true or false
What does the = operator mean in JavaScript?
assigned to
How do you update the value of a variable?
= (equals sign)
What is the difference between null & undefined?
Null = a represents a reference to a nonexistent or invalid object. undefined= is a primitive value automatically assigned to a varibales but with no value
Give 5 examples of JavaScript primitives?
strings, null, boolean,number, bigint, undefined, symbol
Why is it a good habit to include “labels” when you log values to the brower console?
so you know what you are console logging