Update 15-内置对象 String:字符串的常见方法.md

【纠正错误】'o' -> 'a'
This commit is contained in:
猿恋 2022-08-24 11:46:08 +08:00 committed by GitHub
parent 83a0ca5c6c
commit 7539722960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);