const str = "hello world hello"; console.log(str.indexOf("hello")); // 1 console.log(str.indexOf("yellow")); // -1 (not exists) console.log(str.indexOf("hello", 4)); // 12
▶
0
-1
12
CC-BY-SA 3.0 · Powered by MediaWiki
개인정보처리방침 · ABOUT