const s = "hello world"; console.log(s.includes("world")); // indexOf returns the position, or -1 when absent console.log(s.indexOf("o"), s.indexOf("z"));
includes and indexOf