Check If String Contains Substring in Javascript

let str = 'nilpointer';
let keyword1 = 'poi';
if (str.includes(keyword1)) {
    console.log('keyword1 is in the string')
} else {
    console.log('keyword1 is not in the string')
}
keyword1 is in the string