Skip to content

arguments

Reports using the arguments object instead of rest parameters.

✅ This rule is included in the ts logical and logicalStrict presets.

The arguments object is an array-like object available in non-arrow functions that contains the values of the arguments passed to the function. However, it lacks Array methods like map, filter, and forEach, making it inconvenient to work with. Rest parameters provide a real Array, which is more versatile and easier to use.

AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0s11<()sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEle53totAE <= sp ansty="le--0:#F78C6C;--1:#AA09">8<20sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEf53< (sp ansty="le--0:#C792EA;--1:#8844">AEle5<3isp ansty="le--0:#C792EA;--1:#8844">AE <= sp ansty="le--0:#F78C6C;--1:#AA09">8<20sp ansty="le--0:#D6DEEB;--1:#403F">53; A5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72argumenA72leng53;< isp ansty="le--0:#C792EA;--1:#8844">AE<++sp ansty="le--0:#D6DEEB;--1:#403F">53)< {d ivclassNa="meec-li">53 < sp ansty="le--0:#D6DEEB;--1:#403F">53totaAE<+=sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72argumen53[i<];d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEretu53 tota5<3}d ivclassNa="meec-li">dAEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0logA11<()sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53consoAB0l5<3(sp ansty="le--0:#7FDBCA;--1:#096E">72argumen53<);d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>
44AEfunc361B<0sum spans="tyle--0:#D9F5DD;--1:#11">1<111( spans="tyle--0:#7FDBCA;--1:#09">6E7<2... spans="tyle--0:#D7DBE0;--1:#40">3F53va6361B0nu3F<53[] spans="tyle--0:#D9F5DD;--1:#11">1<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de44AEre3F53 va4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0re31<111( spans="tyle--1:#40"><3F53 spans="tyle--0:#D7">DBE0tDEDBE0v1<111) spans="tyle--0:#D6DEEB;--1:#40">344 spans="tyle--0:#D6DEEB;--1:#40">3F53 to>4<4AE+ spans="tyle--0:#D6DEEB;--1:#40">3F53 v6<67B, spans="tyle--0:#D6DEEB;--1:#40">30<9820 spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">3c44AEfunc361B0lo1<111( spans="tyle--0:#7FDBCA;--1:#09">6E7<2... spans="tyle--0:#D7DBE0;--1:#40">3F53i6361B0unk3F<53[] spans="tyle--0:#D9F5DD;--1:#11">1<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53con4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B<0log spans="tyle--0:#D6DEEB;--1:#40">3F53(ite3<);>

This rule is not configurable.

If you need to support environments that don’t have rest parameter syntax, such as ES5 or earlier, you may need to disable this rule. However, most modern JavaScript environments support rest parameters.