Wrapper classes have surprising behaviour, such as
new Boolean(false)
evaluating totrue
.
🐊Putout plugin adds ability to remove useless constructors
. Use with remove-useless-new.
npm i @putout/plugin-remove-useless-constructors
{
"rules": {
"remove-useless-constructors": "on"
}
}
const s = String('hello');
const b = Boolean(false);
const n = Number(5);
const s = 'hello';
const b = false;
const n = 5;
MIT