局部变量

一个 变量,它的名称仅在其 局部作用域 内绑定到其

示例

js
let global = 5; // A global variable

function fun() {
  let local = 10; // A local variable
}

另见