diff options
Diffstat (limited to 'js/README.md')
-rw-r--r-- | js/README.md | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/js/README.md b/js/README.md index 8a46f598b..8e2a373da 100644 --- a/js/README.md +++ b/js/README.md @@ -9,8 +9,25 @@ then run: The news app uses [Traceur](https://github.com/google/traceur-compiler) to transpile ES6 into ES5. If you want to take a look at the features see [the language features reference](https://github.com/google/traceur-compiler/wiki/LanguageFeatures#language-features). -* Modules can not be used since the code is inlined -* The following iterators are available: **items** +### Iterator +The following iterators are defined and availabe: + +* **items**: + + ```js + // iterate over object key and value + for (let [key, value] of items(obj)) { + console.log(`object key: ${key}, object value: ${value}`) + } + ``` +* **enumerate**: + + ```js + // iterate over object key and value + for (let [index, value] of enumerate(list)) { + console.log(`at position: ${index}, value is: ${value}`) + } + ``` ## Building Watch mode: |