Variables and scoping in ECMAScript 6