1/10
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Write down what the following statements will return: 2 == "2";
true
Write down what the following statements will return: 2 === 2;
true
Write down what the following statements will return: 10 % 3;
1
Write down what the following statements will return: 10 % 3 === 1;
true
Write down what the following statements will return: true && false;
false
Write down what the following statements will return: false || true;
true
Write down what the following statements will return: true || false;
true
The code should console.log "Keep it up!" because the value of the isLearning variable is truthy. That means the code inside of the if {} will be evaluated and not the else {}
Since true is a "truthy" value, we can let the if statement turn the expression into a value that is true or false. True will evaluate into a truthy value
The code should console.log "Third" because the thirdVariable is truthy. Even though the firstVariable is falsey, the or statement is only looking for one truthy statement.
The value of firstVariable is undefined
. Variables that are not assigned to any value are assigned to the value undefined
No, undefined
is a falsey value
No, empty strings are falsey values as well
Yes, all numbers except for 0 are truthy
Research Math.random
here and write an if statement that console.log's "Over 0.5" if Math.random
returns a number greater than 0.5. Otherwise console.log "Under 0.5".
What is a falsey value? List all the falsey values in JavaScript.
A falsey value in JavaScript is a value that evaluates to false when encountered in a Boolean context. The falsey values include: false, 0, -0, 0n, "", null, undefined, and NaN.