![]() All modern browsers support includes() method.Includes() method is generic and hence does not require this value to be Array object, but can be applied to Array-like objects.EcmaScript 2015 has added includes() for String and EcmaScrpt 2016 has added includes() for arrays.If the receiver object of the method indexOf call has includes a method, with both having the same parameters, it has a suggestion like types, String, Array, ReadonlyArray, and other typed arrays.In some cases, where the user needs the exact location of a specified element, indexOf(element) can also be used to first get the element’s location.If we look at the above examples, the simplest way to check for a primitive value in the array is to use the include() method. ![]()
0 Comments
Leave a Reply. |