This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var g, h; | |
function x() { f = ""; } | |
function y() { h = f; } | |
{ | |
// var-scoped f is undefined, let-scoped f is a function | |
f = 1; // let-scoped f gets value 1 | |
x(); // var-scoped f gets value "" | |
y(); // h gets value of var-scoped f | |
function f() {} // var-scoped f gets value of let-scoped f |