$ cnpm install @putout/plugin-remove-double-negations
To explicitly convert its return value (or any expression in general) to the corresponding boolean value can be used a double NOT operator (
!!).(c) MDN
????Putout plugin adds ability to remove double negations from conditionals. Merged to remove-unused-type-convertion
npm i @putout/plugin-remove-double-negations
{
"rules": {
"remove-double-negations": "off"
}
}
if (!!a) {
console.log('hi');
}
if (a) {
console.log('hi');
}
MIT
Copyright 2013 - present © cnpmjs.org | Home |