正如问题的标题所说,是否有胡子/把手循环对象属性的方式?
所以
var o = {
bob : 'For sure',
roger: 'Unknown',
donkey: 'What an ass'
}
Run Code Online (Sandbox Code Playgroud)
我可以在模板引擎中做一些相当于的事情
for(var prop in o)
{
// with say, prop a variable in the template and value the property value
}
Run Code Online (Sandbox Code Playgroud)
?