Activity 2

1. What does let allow in JavaScript?

2. What does the typeof operator return for null?

3. How many primitive data types are there in JavaScript?

4. Which is a correct way to declare a string in JavaScript?

5. Which operator is used to compare both value and type?

6. Which data type can store true/false values?

7. What does the + operator do in JavaScript?

8. Which data type is used for text in JavaScript?

9. What happens when a const variable is reassigned?

10. What happens if you declare a variable using let inside a block?

Correct Answers

1. What does let allow in JavaScript? ✅ Block scope

2. What does the typeof operator return for null? ✅ object

3. How many primitive data types are there in JavaScript? ✅ 7

4. Which is a correct way to declare a string in JavaScript? ✅ All of the above

5. Which operator is used to compare both value and type? ✅ ===

6. Which data type can store true/false values? ✅ Boolean

7. What does the + operator do in JavaScript? ✅ Adds numbers and concatenates strings

8. Which data type is used for text in JavaScript? ✅ String

9. What happens when a const variable is reassigned? ✅ It throws an error

10. What happens if you declare a variable using let inside a block? ✅ It has block scope

Instructions:

Set Up Your Development Environment

Understanding JavaScript Operators

Final Output

JavaScript Operators