Skip to content

Latest commit

 

History

History
117 lines (98 loc) · 1.53 KB

File metadata and controls

117 lines (98 loc) · 1.53 KB

img

Javascript objects scopes and closures quizes

Question #0

What is the ouput of this code?

function myFunction(a) {
    console.log(a);
}

const a = 12;
myFunction(89);
  • 2
  • 1
  • 12
  • 89

Question #1

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

Question #2

What is the output of this code?

function myFunction(a) {
    console.log(a + b);
}

const b = 79;
myFunction(10);
  • 89
  • 10
  • 79

Question #3

What is the output of this code?

const number = 12;
function myFunction(a) {
    console.log(a);
}

myFunction(number);
  • 2
  • 1
  • 12

Question #4

What is the output of this code?

function myFunction(a) {
    console.log(a);
}

const number = 12;
myFunction(number);
  • 2
  • 1
  • 12

Question #5

What is the output of this code?

function myFunction(a) {
    console.log(a);
}

myFunction(12);
  • 2
  • 1
  • 12

Question #6

What is the output of this code?

const b = 79;
function myFunction(a) {
    console.log(a + b);
}

myFunction(10);
  • 79
  • 89
  • 10

Question #7

What is the output of the following code?

const a = 12;

function myFunction(a) {
    console.log(a);
}

myFunction(89);