javascript - Difference between String.prototype.includes/contains in ES6? What about .has? -
i wondering of these methods become standard. i've seen both methods yield similar results, yet i'm not sure why there 2 versions/aliases. there difference among them? also, why did es6 use .has when could've used .contains or .includes serve multiple purposes under 1 name.
i aware .has isn't used on strings.
support tests:
| contains includes chrome | no yes firefox | yes yes nodejs | yes no
Comments
Post a Comment