ALL Flashcards
(185 cards)
7 data types
numbers, strings, boolean, objects, arrays, null, undefined
strings
words
what is interpolation
back ticks ``
interpolation operators
${}
how to combine text
“word” + “word”
Boolean
conditional statement if this do this
what is falsey data
false, null, undefined,null, 0, NaN, empty “ “
Strict Equality operators
===
strict inequality operators
!==
3 logical operators
Not (!), And (&&), Or(||)
tenary expressions
if then statement
tenary structure
value/condition ? return if true : return if false
Variable Declaration
a statement: const cat=”rose”
2 code statements
Selection and Repetition
Selection statement
if, else, else if
if statement structure
if (condition) {
thing to do if true
}
else statement structure
if (condition) {
thing to do if true
} else {
thing to do if false
}
if else
if (condition) {
thing to do if true
} else if (condition 2) {
thing to do if condition 2 is true}
switch statement
alternate for conditional statement with multiple conditions again same value
switch statement structure
switch (expression) {
case value1:
//Statements executed when the
//result of expression matches value1
[break;]
case value2:
//Statements executed when the
//result of expression matches value2
[break;]
…
case valueN:
//Statements executed when the
//result of expression matches valueN
[break;]
[default:
//Statements executed when none of
//the values match the value of the expression
[break;]]
}
Default
set of statements to run after all of the switch statement cases have been checked
Break
stop switch statement from continuing to look at case statements once it finds a match
logging
process of printing information about the program as it runs. example: console.log
Repetition statement
while