如何遍历JavaScript对象中的所有成员,包括作为对象的值.
例如,我怎么能循环这个(访问每个的"your_name"和"your_message")?
var validation_messages = {
"key_1": {
"your_name": "jimmy",
"your_msg": "hello world"
},
"key_2": {
"your_name": "billy",
"your_msg": "foo equals bar"
}
}
Run Code Online (Sandbox Code Playgroud) javascript ×1