📜  字符串包括 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:03.035000             🧑  作者: Mango

代码示例4
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"