Show List

Quiz - JavaScript - 2

79%

Public Average Score
Select the right answer for below questions:

What is the output of the following JavaScript code? console.log(NaN == NaN);
TRUE
FALSE
undefined
Null
FALSE

How do you access an element in an array in JavaScript?
Using an index number
Using a property name
Using a keyword
Using a loop
Using an index number

Which of the following is not a type of loop in JavaScript?
For
While
Do-while
Until
Until

What is the output of the following JavaScript code? console.log(10 % 3);
3
1
0.33
1.33
1

What is the purpose of the “continue” statement in a JavaScript loop?
To terminate the loop
To skip the current iteration
To start a new iteration
None of the above
To skip the current iteration

How do you declare an object in JavaScript?
Using an array
Using a function
Using a literal notation
Using a keyword
Using a literal notation

What is the difference between “var” and “let” in JavaScript?
“var” has function scope while “let” has block scope
“var” has global scope while “let” has local scope
There is no difference
“var” is not used in JavaScript
“var” has function scope while “let” has block scope

What is closure in JavaScript?
A function that returns a function
A function that retains access to variables in its outer scope
A function that creates a new scope
A function that cannot be called
A function that retains access to variables in its outer scope

What is the output of the following JavaScript code?console.log(!0);
FALSE
TRUE
Null
Undefined
TRUE

How do you create a conditional statement in JavaScript?
Using “if” statement
Using “switch” statement
Both A and B
None of the above
Both A and B

Submit
Retry
{"qz1-692429":"FALSE","qz1-692430":"Using an index number","qz1-692431":"Until","qz1-692432":"1","qz1-692433":"To skip the current iteration","qz1-692434":"Using a literal notation","qz1-692435":"“var” has function scope while “let” has block scope","qz1-692436":"A function that retains access to variables in its outer scope","qz1-692437":"TRUE","qz1-692438":"Both A and B"}

    Leave a Comment


  • captcha text