js ตรวจสอบว่าข้อความเกี่ยวกัจากตารางคู่ลำดับ
wordsArray = ['hello', 'to', 'nice', 'day']
yourString = 'Hello. Today is a nice day'.toLowerCase()
result = wordsArray.every(w => yourString.includes(w))
console.log('result:', result)
โปรดตรวจสอบว่าอาเรย์ไม่มีส่งข้อควา js
function checkInput(input, words) {
return words.some(word => input.toLowerCase().includes(word.toLowerCase()));
}
console.log(checkInput('"Definitely," he said in a matter-of-fact tone.',
["matter", "definitely"]));