Chap. 1 eloquent javascript Flashcards
(100 + 4) * 11
1,144
What character to use to get a space at “And”
“This is the first line And this is the second”
\n
write out:
“A newline character is written like “\n”.”
as code
“A newline character is written like "\n”.”
The following returns?
console.log(half of 100 is ${100 / 2}
);
‘Half of 100 is 50’
${} is called
template literal
The following returns:
console.log(- (10 - 2))
-8
console. log(typeof 4.5)
console. log(typeof “x”)
// → number // → string
console.log(3 > 2)
// → true
console.log(3 < 2)
// → false
console.log(“Itchy” != “Scratchy”)
// → true
console.log(“Apple” == “Orange”)
// → false
console.log(NaN == NaN)
// → false
> =
greater than or equal too
<=
less than or equal too
!=
not equal too
= =
equal too
console.log(true && false)
// → false
console.log(true && true)
// → true
console.log(false || true)
// → true
console.log(false || false)
// → false
!true
False
!False
True
console.log(true ? 1 : 2);
// → 1
console.log(false ? 1 : 2);
// → 2
There are two special values, written ____ and ____, that are used to denote the absence of a meaningful value
Null
undefined
console.log(8 * null)
// → 0
console.log(“5” - 1)
// → 4
console.log(“5” + 1)
// → 51