Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mdn includes

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"
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #mdn #includes
ADD COMMENT
Topic
Name
8+1 =