Will the following code throw an error?
console.log "Hello Error"
Yes
What is the output of the following code?
if (2 > 1) {
console.log(true);
}
else {
console.log(false);
}
true
Which of the following is not a type of a variable:
1) Integer
2) Float
3) Magnet
4) Array
3) Magnet
Which text is selected:
<html>
<head>
<style>
h1 {color: red; }
</style></head>
<body>
<h1>Hey</h1>
<h2>Hello</h2></body></html>
"Hey"
Which of the following is not a valid DOM command:
-document.querySelector
-document.get Element By Id
-document.setAttribute
-document.appendChild
document.get Element By Id
Will the following code throw an error?
var x=5;
var y=12356;
console.log(x+y);
No
What is the output of the following code?
if (2 > 1 && 1 < 2) {
console.log(true);
}
else {
console.log(false);
}
true
console.log(5 - 3);
Integer
Given the two table codes, which ones best match the image shown in the notes?
Code #1
Which command can be used to change a HTML's button attribute:
-document.getElementById
-document.setAttribute
-document.querySelector
document.setAttribute
Given that this code is all at the same line, is it going to throw an error?
var one = 5; console.log(one + 3); console.log(1 - 2);
No
What is the output of the following code?
if (2 + 3 > 1 || 1 < 2) {
console.log(true);
}
else {
console.log(false);
}
true
What is the type of the following variable:
console.log(3.6 - 2.1);
Float
Which of the following HTML elements will make text bold:
1) <strong>
2) <red>
3) <html>
4) <script>
<strong>
True or False: We can have a loop inside another loop
True
In which line does the following code crash?
var z = 2;
if z > 1 {
console.log(b);
}
Line 3: b is not defined
What is the output of the following code?
if (2 - 3 === 1 && 1 !== 2) {
console.log(true);
}
else {
console.log(false);
}
false
What is the type of the following variable:
var a;
Undefined
How many elements have a red color?
<style>
.hey {color: red;}
</style>
<h1 class"hey">Hello</h1>
<h2 class="hey">Hi</h2>
<h3>
2
True or False: We can have a loop inside a function
Will this code throw an error? If so, which line?
for (i = 0; i < 3; i++) {
console.log(i);
}
Line 1: i is not defined using var.
How many of the following statements are True?
console.log(1 === 2 && 1 >= 1);
console.log(2 > 3 || 1 < 2);
console.log((1 + 1) !== 2);
What is the type of the following code:
console.log(2 + "3");
String
Which of the following displays a color panel:
1) <input type="number"></input>
2) <input id="text" type="text"></input>
3) Both of the above
4) None of the above
4) None of the above
What is the output of the following code?
function helloWorld() {
console.log("hey");
}
No output, function wasn't called