WorksheetsVariables/Conditionals
Total questions: 6
Worksheet time: 3mins
What is the value of this variable?
let myVariable;
null
0
undefined
defined
What is the value of this variable?
let someVariable = true;
someVariable = 58;
58
true
error
null
What will happen when this code runs?
const newVariable = ["an", "array", "of", "strings"];
newVariable = "Just a string";
console.log(newVariable);
null
it will print "just a string" to the console
nothing
error
What will print to the console?
let myNumber = 45;
if(myNumber < 20){
console.log("I am less then twenty");
}
nothing
I am less then twenty
error
undefined
What will print to the console?
let myString = "hello";
if (myString === "HELLO"){
console.log("it matches")
} else {
console.log("It does not match")
}
it matches
error
nothing
It does not match
What will print to the console?
const myBoolean = false;
if (myBoolean === true){
myBoolean = "Yellow";
console.log(myBoolean);
} else if (myBoolean === false){
myBoolean = "Blue";
console.log(myBoolean);
} else {
console.log("It didn't work");
}
Yellow
Blue
error
It din't work
