Introduction
Namaste, In this blog I will discuss 7 FAQs on Javascript fundamentals.
Video Tutorial
Identify the output of the below program
let $=20; console.log("value", $);
a.error
b.20
c.undefined
d. null
e.no output
Answer:b
Reason: $ is a valid variable name.
Identify the output of the below program
let _=100; console.log("value", _);
a.error
b.null
c.undefined
d. 100
e.no output
Answer:d
Reason: _ is a valid variable name.
Identify the output of the below program
let ರಾಮ್ = "Ram"; console.log("value", ರಾಮ್);
a.error
b.undefined
c.Ram
d. null
e.no output
Answer:c
Reason: ರಾಮ್ is a valid variable name.
Identify the output of the below program
let राम = "Ram"; console.log("value", राम);
a.Ram
b.error
c.undefined
d. null
e.no output
Answer: a
Reason: राम is a valid variable name.
Identify the output of the below program
let class= "JS"; console.log("value", class);
a.JS
b.class
c.error
d. undefined
e.null
Answer: c
Reason: Here class is a reserved word, reserved words cannot be used as variables.
Identify the output of the below program
let function = 10; console.log("value", function);
a.error
b.10
c.undefined
d. null
e.no output
Answer: a
Reason: Here function is a reserved word.Cannot use reserved words as variable names.
Identify the output of the below program
let राम = "Ram"; console.log("type", typeof राम);
a.error
b.string
c.null
d. undefined
e.no output
Answer:b
Reason: Since राम is a valid variable and holds string data the type is a string.