Answers for "includes in the string"

10

.includes( string

var str = "Hello world, welcome to the universe.";
var n = str.includes("world");
Posted by: Guest on November-14-2019
0

string include

const sentence = 'The quick brown fox jumps over the lazy dog.';
const word = 'fox';

console.log(`The word "${word}" ${sentence.includes(word) ? 'is' : 'is not'} in the sentence`);
// expected output: "The word "fox" is in the sentence"
Posted by: Guest on June-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language