Skip to content

Instantly share code, notes, and snippets.

(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