JavaScript Basics Quiz
???
JavaScript Basics Quiz
?: If we declare a variable, let test = 1
, then later, reassign, stating test = 2
, what will happen?
(X) test
will equal 2
( ) test
will equal 1
( ) JavaScript will raise a TypeError ( ) test
will equal undefined
?: If we declare a variable, const test = 1
, then later, reassign, stating test = 2
, what will happen?
( ) test
will equal 2
( ) test
will equal 1
(X) JavaScript will raise a TypeError ( ) test
will equal undefined
?: If we declare a variable, let test = 1
, then later, reassign, stating var test = 2
, what will happen if both are in the same scope?
( ) both variables will be declared (X) JavaScript will raise a SyntaxError ( ) var test
will reassign let test
( ) var test
will be ignored as test
is already declared
?: If we declare a variable, var test = 1
, then later, reassign, stating var test = 2
, what will happen?
( ) both variables will be declared ( ) JavaScript will raise a SyntaxError (X) var test = 2
will reassign var test = 1
( ) var test
will be ignored as test
is already declared
?: What are the main differences between let
and const
?
(X) let
can be reassigned, const
cannot be reassigned ( ) let
cannot be reassigned, const
can be reassigned ( ) let
is functional scope, while const
is block scope ( ) let
is block scope, while const
is functional scope
?: The !=
and !==
symbols both work the same for inequality comparisons:
( ) True (X) False
?: For strict equality comparisons, we should use:
( ) =
( ) ==
(X) ===
?: The expression 8 >= 8
evaluates to:
(X) True ( ) False
?: The expression 8 > 8
evaluates to:
( ) True (X) False
?: The expression 8 === "8"
evaluates to:
( ) True (X) False
?: The expression 8 == "8"
evaluates to:
(X) True ( ) False
?: What will the return value of the following expression be?
(X) true
( ) false
?: What will the return value of the following expression be?
( ) true
(X) false
?: What will the return value of the following expression be?
(X) true
( ) false
?: What will the return value of the following expression be?
( ) true
(X) false
?: What will the return value of the following expression be?
(X) true
( ) false
?: What will the value of str
be after the following expression runs?
(X) "hello"
( ) "world"
( ) undefined
( ) null
?: What will be the value of result
when this code is run and the function, quizFunction
, is called with the input of 5
?
( ) argument
( ) "5"
( ) "argument"
(X) 5
?: What will be the value of result
when this code is run and the function, quizFunction
, is called with the input of 10
?
( ) argument/2
(X) 5
( ) "argument/2"
( ) 10/2
?: What will be the value of result
when this code is run and the function, quizFunction
, is called with the input of 10
?
( ) argument < 5
( ) true
( ) 10
(X) false
?: What will be the value of result
when this code is run and called with the input of 5
?
(X) 9
( ) 13
( ) TypeError ( ) undefined
?: What about if we flipped the order of the same functions?
( ) 9
(X) 13
( ) TypeError ( ) undefined
???
Last updated