Question: Given the following javascript code: function func ( ) { if ( condition 1 ) { KEYWORD x = 4 2 / / KEYWORD intended
Given the following javascript code:
function func
ifcondition
KEYWORD x KEYWORD intended to be var, let, or const
ifcondition
console.logxLine
Which ONE of the following is TRUE with regards to whether KEYWORD is var, let, or const?
Question options:
Line will NOT be a "ReferenceError: x is not defined" error if KEYWORD is const.
Line will be a "ReferenceError: x is not defined" error if KEYWORD is let.
Line will be a "ReferenceError: x is not defined" error if KEYWORD is var.
Line will be a "ReferenceError: x is not defined" error regardless of whether KEYWORD is var, let, or const.
Line refers to global variable x regardless of whether KEYWORD is var, let, or const.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
