Variables & Data Types
Functions
Conditionals & Operators
Arrays & Loops
Objects & DOM
100

What data type is "42"?

String

100

What is wrong?

function add(num1, num2)
    return num1 + num2;
}

Missing { after declaration

100

What is an if statement used for?

To make decisions in code based on conditions.

100

What is an array used for?

To store multiple values in one variable

100

What is an object?

A collection of properties and their values

200

What is outputted to the console:

const num = 17;

const num2 = "17"

console.log(num+num2);

1717

200

What are parameters?

Inputs of a function

200

What is outputted to the console?

let x = 5;
let y = 10;
console.log(x > 3 && y > 20);

False

200

What is an index?

The position of an item in an array.

200

What is a method?

A function inside an object.

300

What is a variable used for?

A container used to store data values

300

What is a function?

A reusable block of code that performs a task.

300

Difference between || and &&?

|| (or) is true if one or both conditions are true

&& (and) is true only if both conditions are true

300

What is wrong with this code:
for(let i = 0; i <= 5; i--){

    console.log(i);

}

Counter decreases but condition increases 

infinite loop


300

What's wrong?

const person = {

    name: "Alex"

    age: 20

};

Missing comma between properties

400

Difference between = and ===?

= assigns a value

=== compares value and type


400

What does it mean to call a function?

To run or execute the function

400

Difference between == and ===?

== Compares values after type conversion (coercion)

=== Compares both value and data type


400

What is outputted to the console:

let nums = [2, 17, 9, 23, 4, 6, 7, 0, 6];

for(let i = 0; i < nums.length; i=i+2){
    console.log(nums[i]);
}



2

9

4

7

6

400

What is the top-level object in the DOM?

document

500

What will be printed to the console?

let x = 10;
let y = "5";

console.log(typeof (x + y));

console.log(typeof x + y);



string
number5
500

Write a function that squares a number

function square(num){

    return num * num;

}

500
What is outputted to the console?

let x = 5;
let y = 10;
let z = 3;

console.log((x < z || y == "10") && x === "5");


False

500

What is outputted to the console:

let nums = [15, 4, 12, 19, 1, 31, 14, 9, 26];

for(let i = 1; i < nums.length-1; i++){
    if(nums[i]>10) {
        console.log(nums[i]);
    {
}


12

19

31

14

500

Write a line of JavaScript that stores the DOM element with the id "thisDiv" in a variable

const thing = document.getElementById("thisDiv");



M
e
n
u