Eloquent JS terms Flashcards
values
to organize bits better, they are separated into chunks known as values
numbers
are values of a number type:
200 +4 * 11
numbers are integers, and operators are plus & addition
%
modulo, mod for short
remainder
ex: 300%100 -> 3 with a remainder of 14
144%12 -> 12, with a remainder of 0
NaN
not a number
you ge this when you try to do math like 0/0, or other operations that don’t yield meaninful results
string
- basic data types that represent text
- enclosed in quotes
concatinate
“con” + “cat” + “e” + “nate”
template literals
back tick quoted strings can span lines & embed other values
ex: ‘half of 100 is ${100/2}
is
“half of 100 is 50”
Unary operators
- some operators are written in words instead of symbols
- ex: typeof operator -> produces a string value naming the type of the value you give it
Boolean Values
Distinguishes between only 2 possibilities like yes/no, true/false
ex: console.log (3 > 2)
// true
conosle.log (3 < 2)
// false
Binary operators
ex: + -
Operator Types
> = greater than or equal to
< = less than or equal to
= = equal to
! = not equal to
Logical operators
&& and
|| or
! not
? : conditional operator that is ternary
Used to denote the absence of meaningful value and are mostly interchangeable
NULL
UNDEFINED
This catches and holds values, imagine them as tentacles rather than boxes
Variable/Binding
Some keywords that denote bindings/variable
var
const
let