Let variable scope CODE
Variable described using keyword
let
uses block scope
let myNumber = 1

function callMePlease() {
  let myNumber = 2
  
  if (1 == 1) {
    let myNumber = 3    
    document.write('My number is: ' + myNumber + '</br>')
  }  
  document.write('My number is: ' + myNumber + '</br>')
}

document.write('My number is: ' + myNumber + '</br>')

callMePlease()
by Valeri Tandilashvili
4 years ago
JavaScript
Variables
1
Pro tip: use ```triple backticks around text``` to write in code fences