部分文字列の最初・最後の出現インデックスを返す
'hello world'.indexOf('o'); // 4
'hello world'.lastIndexOf('o'); // 7
'hello world'.indexOf('xyz'); // -1
// 含有チェックにはincludes推奨
'hello'.includes('ell') // true ← より可読性が高い含有チェックだけならincludes()のほうが可読性が高い。位置が必要な場合にindexOfを使う。