Intro to JS Flashcards
Truthy
values that are evaluated as true in a Boolean context
Falsy
values that are evaluated as false in a Boolean context
Automatic Semicolon Insertion (ASI)
TBD
Type Coercion
TBD
Expression
code that returns a value
4 + 5; myVariable; Math.random();
Statement
code that performs an action
if..else; try…catch; switch;
hoisting: functions
yes
hoisting: variables
also yes, but in lines before attribution will evaluate to undefined
undefined
placeholder for a (assumed) future value;
the air inside a container before the container is used
Number.isNaN or isNan
Number.isNaN
isNan(“string”) === true
globalThis
reference to the global this (window)
try..catch block has ? many components
try {…} catch(err) {…} finally {…}
if there are 2 try..catch..finally, one nested, what happens if the inner catch throws an error and inner finally returns a value
outer catch will not ‘catch’ error thrown by inner catch
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try…catch#returning_from_a_finally-block