


Since the word "love" is included inside the str, then the code will return true. In the code, str would be "I love freeCodeCamp" and the search-string would be "love". We want to see if the word "love" is included in that sentence. In this first example, we have the sentence, "I love freeCodeCamp". If the search-string is not found then it will return false. If the search-string is found then it will return true. If the position parameter is omitted then the default is zero. The position parameter is an optional number for the starting search position in the str. The search-string parameter is the string you are searching for in str. includes() method: str.includes(search-string, optional-position) In this article, I will walk you through a few code examples of the JavaScript string method called. includes() method to see if one string is found in another.
