The most simple one, is using the
includes() method on a string
"this is a string".includes("string"); //true
based on caniuse.com the
includes() function is supported by all browsers except Internet Explorer.
ìncludes() can accept a second paramater, an Integer which Indicates the Position where to start searching for
You like our Content? Follow us to stay up-to-date.