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.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

In JavaScript, variables are declared using which keyword?

  1. var
  2. let
  3. const
  4. All of the above
Question 2 Multiple Choice (Single Answer)

What is the data type of a variable that can store whole numbers?

  1. Number
  2. String
  3. Boolean
  4. Undefined
Question 3 Multiple Choice (Single Answer)

Which of the following is not a valid JavaScript data type?

  1. Number
  2. String
  3. Boolean
  4. Array
Question 4 Multiple Choice (Single Answer)

What is the data type of a variable that can store text?

  1. Number
  2. String
  3. Boolean
  4. Undefined
Question 5 Multiple Choice (Single Answer)

Which of the following is not a valid JavaScript operator?

  1. +
  2. -
  3. *
  4. /
  5. %
Question 6 Multiple Choice (Single Answer)

What is the result of the following expression: 10 + 20?

  1. 30
  2. 40
  3. 50
  4. 60
Question 7 Multiple Choice (Single Answer)

What is the result of the following expression: 10 - 5?

  1. 5
  2. 10
  3. 15
  4. 20
Question 8 Multiple Choice (Single Answer)

What is the result of the following expression: 10 * 2?

  1. 20
  2. 30
  3. 40
  4. 50
Question 9 Multiple Choice (Single Answer)

What is the result of the following expression: 10 / 2?

  1. 5
  2. 10
  3. 15
  4. 20
Question 10 Multiple Choice (Single Answer)

What is the result of the following expression: 10 % 3?

  1. 1
  2. 2
  3. 3
  4. 4
Question 11 Multiple Choice (Single Answer)

What is the data type of a variable that can store true or false?

  1. Number
  2. String
  3. Boolean
  4. Undefined
Question 12 Multiple Choice (Single Answer)

What is the result of the following expression: true && false?

  1. true
  2. false
  3. undefined
  4. null
Question 13 Multiple Choice (Single Answer)

What is the result of the following expression: true || false?

  1. true
  2. false
  3. undefined
  4. null
Question 14 Multiple Choice (Single Answer)

What is the result of the following expression: !true?

  1. true
  2. false
  3. undefined
  4. null
Question 15 Multiple Choice (Single Answer)

What is the result of the following expression: !false?

  1. true
  2. false
  3. undefined
  4. null