[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,10 +13,10 @@ Method:
|
||||
```javascript
|
||||
|
||||
for (let user in obj) {
|
||||
if(obj.user.online === true) {
|
||||
//code
|
||||
}
|
||||
if(obj.user.online === true) {
|
||||
//code
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
@ -27,10 +27,10 @@ for (let user in obj) {
|
||||
```javascript
|
||||
|
||||
for (let user in obj) {
|
||||
if(obj[user]online === true) {
|
||||
//code
|
||||
}
|
||||
if(obj[user].online === true) {
|
||||
//code
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user