📜  包含在 js 中 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:09.806000             🧑  作者: Mango

代码示例6
const str = 'To be, or not to be, that is the question.' 

console.log(str.includes('To be'))        // true
console.log(str.includes('question'))     // true
console.log(str.includes('nonexistent'))  // false
console.log(str.includes('To be', 1))     // false
console.log(str.includes('TO BE'))        // false
console.log(str.includes(''))             // true