$ cnpm install @putout/plugin-convert-index-of-to-includes
The
includes()method determines whether an array includes a certain value among its entries, returningtrueorfalseas appropriate.(c)MDN
????Putout plugin adds ability to convert indexOf to includes.
npm i @putout/plugin-convert-index-of-to-includes -D
{
"rules": {
"convert-index-of-to-includes": "on"
}
}
if (~array.indexOf(element)) {}
if (array.includes(element)) {}
MIT
Copyright 2013 - present © cnpmjs.org | Home |