Closed
Description
In our lib code, we are still using Array#indexOf
to determine if an item is existed in array.
For example:
Line 584 in 3414bc7
node/lib/internal/util/inspect.js
Line 273 in b05fd4b
For semantics, I think it's more appropriate to move them into Array#includes
and it seems no performance difference between them at present: https://jsperf.com/array-indexof-vs-includes.
Metadata
Metadata
Assignees
Labels
No labels