placeholder image to represent content

C D Quiz 3

Quiz by crio

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
5 questions
Show answers
  • Q1

    Which keyword is used to declare a variable with block scope in JavaScript?

    const

    let

    var

    function

    30s
  • Q2

    What is the output of the following JavaScript code snippet? var x = 10; { let x = 20; console.log(x); } console.log(x);

    20, 10

    20, 20

    10, 20

    10, 10

    30s
  • Q3

    What is the difference between 'let' and 'const' when declaring variables in JavaScript?

    'let' allows for hoisting while 'const' does not

    'let' allows variable reassignment while 'const' does not

    'let' is used for global variables while 'const' is used for local variables

    'let' has block scope and 'const' has function scope

    30s
  • Q4

    Which keyword allows for variable hoisting in JavaScript?

    let

    const

    dynamic

    var

    30s
  • Q5

    What is the purpose of using 'const' keyword to declare variables in JavaScript?

    'const' variables have global scope and can be accessed from any part of the code.

    'const' variables are only accessible within the block they are defined in.

    'const' variables can be reassigned multiple times with different values.

    'const' variables are used to create constants, whose value cannot be changed once assigned.

    30s

Teachers give this quiz to your class