Les deux codes suivants sont équivalents
ES2015
|
Before ES2015
|
let x = "G";
function f() {
console.log(x);
}
{
let x = "B";
console.log(`x = ${x}`);
f();
}
|
"use strict";
var x = "G";
function f() {
console.log(x);
}
{
var _x = "B";
console.log("x = "
+ _x);
f();
}
|