I am looking to set an attribute of an object dynamically. Look at the example below.
function testFunc(type, scope){
this.scope = scope;
this.scope.setAttribute(type, true);
this.doSome = function(){return //Something;}
}
but I realized that setAttribute method is only available for DOM elements. Is there a way i can set an attribute dynamically to a js object ?
this.scope[type] = true?