[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:
@@ -13,11 +13,11 @@ Método:
|
||||
### Ejemplo 1:
|
||||
|
||||
```javascript
|
||||
for (let user in obj) {
|
||||
if(obj.user.online === true) {
|
||||
//code
|
||||
}
|
||||
}
|
||||
for (let user in obj) {
|
||||
if(obj.user.online === true) {
|
||||
//code
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* El ejemplo 2 demuestra cómo usar la notación `[square-bracket]` se ejecutará el código.
|
||||
@@ -25,11 +25,11 @@ for (let user in obj) {
|
||||
### Ejemplo 2:
|
||||
|
||||
```javascript
|
||||
for (let user in obj) {
|
||||
if(obj[user]online === true) {
|
||||
//code
|
||||
}
|
||||
}
|
||||
for (let user in obj) {
|
||||
if(obj[user].online === true) {
|
||||
//code
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Solución:
|
||||
|
Reference in New Issue
Block a user