[Fix] correct Guide article example for Iterate Through the Keys of an Object with a for...in Statement (#35197)

* fix: added dot btwn [user] and online

* fix: corrected example for other languages
This commit is contained in:
Randell Dawson
2019-05-05 11:26:22 -07:00
committed by Tom
parent 586730b69a
commit cc6f234228
6 changed files with 64 additions and 58 deletions

View File

@@ -13,11 +13,11 @@ localeTitle:  Итерация через ключи объекта с помо
### Пример 1:
```javascript
for (let user in obj) {
if(obj.user.online === true) {
//code
}
}
for (let user in obj) {
if(obj.user.online === true) {
//code
}
}
```
* В примере 2 показано, как использовать нотацию с `[square-bracket]` код будет выполнен.
@@ -25,11 +25,11 @@ for (let user in obj) {
### Пример 2:
```javascript
for (let user in obj) {
if(obj[user]online === true) {
//code
}
}
for (let user in obj) {
if(obj[user].online === true) {
//code
}
}
```
### Решение: