为啥我的结果是4,4,求大家帮忙看看代码,谢谢大家了
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>string对象 </title> <script type="text/javascript"> var mystr="Hello World!"; var index_1 = mystr.indexOf("o"); var index_2 = mystr.indexOf("o", index_1); document.write(index_1, index_2); </script> </head> <body> </body> </html>