Elisa  Marks

Elisa Marks

1600052203

Javascript String Includes: Check String Contains other String

The string includes() method lets you determine whether or not a  string includes another string.

Javascript String includes()

Javascript string includes() is an inbuilt function that determines whether one string may be found within another string, returning true or false as appropriate. With ES6 JavaScript added the includes method natively to both the Array and String natives. While true or false may provide the answer you need, regular expressions can check if a substring exists with a more detailed answer.

Syntax

See the following syntax.

str.includes(searchString)

#javascript #javascript string includes #js

Javascript String Includes: Check String Contains other String