JavaScript Variables and Data Types
This quiz is designed to assess your understanding of JavaScript variables and data types. It covers various concepts such as variable declaration, data types, and operators.
Questions
In JavaScript, variables are declared using which keyword?
- var
- let
- const
- All of the above
What is the data type of a variable that can store whole numbers?
- Number
- String
- Boolean
- Undefined
Which of the following is not a valid JavaScript data type?
- Number
- String
- Boolean
- Array
What is the data type of a variable that can store text?
- Number
- String
- Boolean
- Undefined
Which of the following is not a valid JavaScript operator?
- +
- -
- *
- /
- %
What is the result of the following expression: 10 + 20?
- 30
- 40
- 50
- 60
What is the result of the following expression: 10 - 5?
- 5
- 10
- 15
- 20
What is the result of the following expression: 10 * 2?
- 20
- 30
- 40
- 50
What is the result of the following expression: 10 / 2?
- 5
- 10
- 15
- 20
What is the result of the following expression: 10 % 3?
- 1
- 2
- 3
- 4
What is the data type of a variable that can store true or false?
- Number
- String
- Boolean
- Undefined
What is the result of the following expression: true && false?
- true
- false
- undefined
- null
What is the result of the following expression: true || false?
- true
- false
- undefined
- null
What is the result of the following expression: !true?
- true
- false
- undefined
- null
What is the result of the following expression: !false?
- true
- false
- undefined
- null