O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

While we’re on the topic of scope, let’s quickly review how lexical scope works:

image with no caption

N

From

Cover of Head First JavaScript Programming

Note

Which variable does the function return? A tip: the local variable is returned first if if shares the name with a global variable.