A variable is a named reference to a value.
(c) MDN
🐊Putout plugin adds ability to find and remove variables without references.
npm i @putout/plugin-remove-unreferenced-variables -D
{
"rules": {
"remove-unreferenced-variables": "on"
}
}
let a;
let b;
a = 5;
b = 6;
console.log(a);
let a;
a = 5;
console.log(a);
MIT