JS Basics (HR) Flashcards
what is the type of “hi”
string literal
what type is - true - and what cn it represent?
boolean. represents opposing ideas, such as on vs off, positive vs negative, present vs absent, or truth vs falsehood
what is the type - underfined - and what does it represent?
undefined value represents an unknown or undetermined state. Will receive this value, when someone or some system is trying to indicate to you that the info you’re inquired about could not be found.
what is the type of 3
number literal
what do you need in order to make calculations
Operators. Operators are things like plus, known as the addition operator, and they imply that some work should be done on the values around them. Research operator precedence if i want to learn more about order of operations
What are expressions?
A set of literals, variables and operators intended to tell your computer how to take one small step forward in a larger computation. When processes at run time, every expression will have a result value. It will “evaluate to”
where to go for understanding how my JS interpreter will process my code, and it what order.
http://jsparse.meteor.com
what is this type of statement? log((3+1)* 2);
expression statement. the semicolon has effect of discarding the result value of the full, compound expression occupying the entire line, allowing the interpret to proceed with clean slate
how would you describe this? var result = (3+1) * 2;
Variable declaration statement.
describe a variable
storing a previously-computed value by naming it with a variable. A variable can be thought of as a “label” or “alias” that points to some value stored
What will the var other log to the console in this scenario? var result = (3+1)*2; log(result); var other = result; result = 5; console.log(other);
- This is because other will store the original value, since our new (overwriting) assignment operation told teh interpreter to make result point to something different, but it did not tell the interpreter to make other point to something different.
what is it called to define an object like this: var myObj = {};
Object literal
In an object, what is the combination of one key and one value called?
property
What does a failed property lookup evaluate to?
undefined
when accessing accessing or assigning properties with bracket access
the value, if not already a string, gets stringified before lookup