Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to Check if a Substring is in a String in JavaScript Using the includes() Method

// Here's what the syntax looks like:
// string.includes(substring, fromIndex)

// Here's an example:

const bio = "I am a web developer";
console.log(bio.includes("web"));
// true
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #How #Check #Substring #String #JavaScript #Using #Method
ADD COMMENT
Topic
Name
3+1 =