let x = 'Javascript' console.log(x.includes('ipt', 4)) // Expected output: false
A 4 indextől kezdve az "ipt" szöveget tartalmazz az adott karakterláncot.
console.log(x.includes('ipt')) // Expected output: true
includes(searchString) includes(searchString, position)
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"