Facebook
From Gamboge Parrot, 5 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 103
  1.    const a = 1; const b = 2; const c = 3;
  2.  
  3.      (function firstFunction () {
  4.        const b = 5; const c = 6;
  5.  
  6.        (function secondFunction () {
  7.          const b = 8;
  8.  
  9.          (function thirdFunction () {
  10.            const a = 7; const c = 9;
  11.  
  12.            (function fourthFunction () {
  13.              const a = 1; const c = 8
  14.            })()
  15.          })()
  16.        })()
  17.      })()
  18.  
  19.   Use your knowledge of the variables' scope and place the following code
  20.   inside one of the functions in scope.js so the output is a: 1, b: 8, c: 6
  21.  
  22.      console.log(`a: ${a}, b: ${b}, c: ${c}`)