diff --git a/docs/javascript.md b/docs/javascript.md index 2220903c..78b7f3eb 100644 --- a/docs/javascript.md +++ b/docs/javascript.md @@ -886,7 +886,6 @@ for (let index in fruits) { ``` ### label 语句 - ```js var num = 0; @@ -916,10 +915,16 @@ for (let fruit of fruits) { // => apple // => orange // => banana + +for (let [index, value] of fruits.entries()) { + console.log(index, value); +} +// => 0 apple +// => 1 orange +// => 2 banana ``` ### for await...of - ```javascript async function* asyncGenerator() {