Why is there a difference between
- for(var user in users) {
p= user //output: user1
- };
and
each user in users
p= user //output: [object Object]
according to http://jade-lang.com, they are aliasses, so why do they have a different output ?
List of users (JSON-format)
users = {
"user1": {
"firstname": "John",
"lastname": "Doe"
},
"user2": {
"firstname": "Jane",
"lastname": "Roe"
}
}
Finally found a solution that works, I had to use value, index
otherwise an object was returned
each value, index in users
li= index //output: user1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With