JS
JS AGAIN
SYNTAX
CODE CHALLENGE
YOUR AWESOME TA
100
You use this to create a container in JavaScript
What is the var keyword?
100

This operator inverts the value of a boolean expression (true becomes false, false becomes true).

Answer: What is the ! (NOT) operator?

100

The values of x, y and z after the execution of the three lines of code below: var x = 5, y = 6, z; x = y++; z = ++y;

What is x equals 6 and y equals 7 (after the x = y++ statement), and z equals 8 and y equals 8 (after the z = ++y statement)?

100
Given... done = (5 > 0); The value of done.
What is true?
100

What data type represents a special value that indicates the absence of any object value?

Answer: What is null?

200
These are all operators used for equality testing.
What is ! / || / && / ===
200

You can chain multiple if statements together to create more complex conditional logic. What keyword is used to introduce subsequent conditions?

Answer: What is else if?

200

This keyword declares a variable with block-level scope and cannot be re-assigned after initialization. It's ideal for values that should remain constant.

Answer: What is const?

200

This loop is similar to a while loop, but it executes at least once before checking the condition.

Answer: What is a do...while loop?

200

ThThis data type indicates that a variable has been declared but not yet assigned a value.

Answer: What is undefined?

300

What keyword declares a variable with block-level scope and can be re-assigned within its scope?

Answer: What is let?

300

Number, String, Boolean, Object, Function

What are the 6 fundamental data types?

300
Given the following code for( var i = 0; i > 100; i++) { //Do something } The syntax errors here cause this
What is an infinite loop?
300

This data type can hold whole numbers, both positive and negative.

What is a number?

300

This data type, also introduced in ES6, is used to represent a unique and immutable identifier.

Answer: What is a symbol?

400

This block of code within an if statement is executed if the condition is false (optional).

Answer: What is the else block?

400

This statement allows you to exit a loop prematurely if a certain condition is met.

Answer: What is the break statement?

400
Given the following code var outter; function test(param1, param2){ //code } The variable outter is able to be used anywhere in the code, but param1 and 2 are not. One thing causes this.
What is scope?
400

This data type represents a single character enclosed in quotation marks (e.g., 'a' or 'Z').

Answer: What is a string?

400

What operator combines two boolean expressions and returns true only if both are true?

Answer: What is the && (AND) operator?

500

What loop iterates a specific number of times based on a counter variable?

Answer: What is a for loop?

500

This loop keeps executing as long as a certain condition remains true.

Answer: What is a while loop?

500
It is a best practice to use "===" instead of "==" in order to avoid this.
What is automatic type conversion?
500

This data type allows you to store key-value pairs and is unordered (e.g., { name: "Alice", age: 30 }).

What is is the following? var userVal1 = Number(prompt("enter value 1")); var userVal2 = What is an object?

500

This operator combines two boolean expressions and returns true if at least one of them is true.

Answer: What is the || (OR) operator?