Javascript objects scopes and closures quizes
What is the ouput of this code?
function myFunction(a) {
console.log(a);
}
const a = 12;
myFunction(89);- 2
- 1
- 12
- 89
What is the output of this code?
let b = 1;
function myFunction(a) {
console.log(a + b);
b = a;
}
myFunction(3);
myFunction(4);- 3, 7
- 3, 4
- 4, 7
- 4, 3
What is the output of this code?
function myFunction(a) {
console.log(a + b);
}
const b = 79;
myFunction(10);- 89
- 10
- 79
What is the output of this code?
const number = 12;
function myFunction(a) {
console.log(a);
}
myFunction(number);- 2
- 1
- 12
What is the output of this code?
function myFunction(a) {
console.log(a);
}
const number = 12;
myFunction(number);- 2
- 1
- 12
What is the output of this code?
function myFunction(a) {
console.log(a);
}
myFunction(12);- 2
- 1
- 12
What is the output of this code?
const b = 79;
function myFunction(a) {
console.log(a + b);
}
myFunction(10);- 79
- 89
- 10
What is the output of the following code?
const a = 12;
function myFunction(a) {
console.log(a);
}
myFunction(89);