indexOf() 會回傳指定字串第一次出現的位置。
"Hello World".indexOf("World"); // 6 "Hello World".indexOf("world"); // -1
若找不到,會回傳 -1。它與 match() 的差異在於回傳位置而非內容。