You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In live-server.js I noticed that you're using String#indexOf to see if an item exists in an array as opposed to the more appropriate String#includes. I doubt there's enough of a performance difference to truly matter but it's much more readable.
It also is slightly less characters overall to use .includes() than .indexOf() > -1
For example:
/* OLD */if(arg.indexOf("--port=")>-1){}/* NEW */if(arg.includes("--port=")){}
The text was updated successfully, but these errors were encountered:
In
live-server.js
I noticed that you're usingString#indexOf
to see if an item exists in an array as opposed to the more appropriateString#includes
. I doubt there's enough of a performance difference to truly matter but it's much more readable.It also is slightly less characters overall to use
.includes()
than.indexOf() > -1
For example:
The text was updated successfully, but these errors were encountered: