mirror of
https://github.com/qianguyihao/Web.git
synced 2024-11-01 05:24:45 +08:00
Update 15-内置对象 String:字符串的常见方法.md
【纠正错误】'o' -> 'a'
This commit is contained in:
parent
83a0ca5c6c
commit
7539722960
@ -133,7 +133,7 @@ var num = 0;
|
||||
while (index !== -1) {
|
||||
console.log(index);
|
||||
num++; // 每打印一次,就计数一次
|
||||
index = str.indexOf('o', index + 1);
|
||||
index = str.indexOf('a', index + 1);
|
||||
}
|
||||
|
||||
console.log('a 出现的次数是: ' + num);
|
||||
|
Loading…
Reference in New Issue
Block a user