まあ言ってみれば:
Foo.user = Ember.Object.extend({
username:null,
name:null,
loadData:function(data){
_.each(data, function(value, key){
console.log(this.hasOwnProperty(String(key)), key, String(key));
console.log((String(key) in this));
console.log(key in this.__proto__);
console.log(_.has(this, key));
...
});
},
})
データはオブジェクトの例です。JSON
テストの Ember の方法または JS OO の方法はありますか??
はい、アンダースコアです... ;)