-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
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
| this.hostname.indexOf(':') === -1 ? |
node/lib/internal/util/inspect.js
Line 273 in b05fd4b
| if (str.indexOf("'") !== -1) { |
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.
luthfianto
Metadata
Metadata
Assignees
Labels
No labels