Consider the following code snippet
const pi=3.14;
var pi=4;
console.log(pi);
What will be the output for the above code snippet?
const pi=3.14;
var pi=4;
console.log(pi);
A. This will flash an error
B. Prints 4
C. Prints 3.14
D. Ambiguity
Answer: Option A
Solution(By Examveda Team)
The above code snippet will flash an error. Attempts to alter the value or re-declaration causes errors.Related Questions on Classes and Modules
The behaviour of the instances present of a class inside a method is defined by
A. Method
B. Classes
C. Interfaces
D. Classes and Interfaces
The keyword or the property that you use to refer to an object through which they were invoked is
A. from
B. to
C. this
D. object
Consider the following code snippet :
The output would be :var o = new F();
o.constructor === F
A. false
B. true
C. 0
D. 1
The basic difference between JavaScript and Java is
A. There is no difference
B. Functions are considered as fields
C. Variables are specific
D. Functions are values, and there is no hard distinction between methods and fields
Join The Discussion