How can I use property : value
pairs in object contexts as if they were var = value
pairs? So without using the this
keyword?
var obj = {
prop_1 : 1,
prop_2 : 2,
myMethod : function(){
this[this.prop_1] = this.prop_1;
return prop_1;
}
}
console.log( obj.myMethod() );