main.js
1
2
3
4
5
6
7
8
9
function bigFunction() {
  // code...
  console.log(myVariable); // => undefined
  // code...
  var myVariable = 'Initial value';
  // code...
  console.log(myVariable); // => 'Initial value'
}
bigFunction();
Native Browser JavaScript