Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the scope of the variable "a" in function below? function val(x){ if(x>0){ let a = x; console.log(a); } }
Home
ECMAScript
What is the scope of the variable "a" in function below? function val(x){ if(x>0){ let a = x;...
0
votes
asked
Jan 21, 2020
in
ECMAScript
by
GeorgeBell
What is the scope of the variable "a" in function below?
function val(x){
if(x>0){
let a = x;
console.log(a);
}
}
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 21, 2020
by
GeorgeBell
Block
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: What will be printed if the following code is executed? let x=150; if(x>100) { x=1; } console.log(x);
asked
Jan 21, 2020
in
ECMAScript
by
GeorgeBell
0
votes
Q: What is the significance of the following code snippet? for (let i = 0; i < 10; i++) { x += 10; }
asked
Jan 21, 2020
in
ECMAScript
by
GeorgeBell
0
votes
Q: What's the output? let number = 0; console.log(number++); console.log(++number); console.log(number);
asked
Feb 26
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 1); } for (let i = 0; i < 3; i++)
asked
Feb 24
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? function sayHi() { console.log(name); console.log(age); var name = 'Lydia'; let age = 21; }
asked
Feb 24
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? for (let i = 1; i < 5; i++) { if (i === 3) continue; console.log(i); }
asked
Feb 26
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What will be the output of following code snippet? function foo(a = 10, b = 5) { console.log(a, b); } foo(6);
asked
Jan 21, 2020
in
ECMAScript
by
GeorgeBell
0
votes
Q: The following code implements the ______ feature of ES6 function myFunction(x, y, z) { } var args = [0, 1, 2]; myFunction(...args);
asked
Jan 21, 2020
in
ECMAScript
by
GeorgeBell
0
votes
Q: What's the output? function sayHi() { return (() => 0)(); } console.log(typeof sayHi());
asked
Feb 27
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: If (0.2)x = 2 and log 2 = 0.3010, then the value of x to the nearest tenth is: (a) -10.0, (b) -0.5, (c) -0.4, (d) -0.2, (e) 10.0
asked
May 21, 2019
in
Mathematics
by
sheetalkhandelwal
#maths
#mathematics
Mathematics-questions-answers
...