0

How to make a word detector in js

Example the detection word is hello, then we use word hello as an input, the output in console will be, word detected and the number of words

28th Mar 2022, 1:00 AM
Domge
Domge - avatar
2 Answers
+ 2
Domge By using includes function var words = prompt("Enter words") if (words.includes('world')) { console.log("Detected") } else console.log("not found")
28th Mar 2022, 1:09 AM
A͢J
A͢J - avatar
+ 2
A͢J yoo thank u so much, it working
28th Mar 2022, 1:22 AM
Domge
Domge - avatar