I want to do the following
var my_json = {
a : 'lemon',
b : 1
}
function obj(json){
this.a = 'apple';
this.b = 0;
this.c = 'other default';
}
after assigning
var instance = obj(my_json)
I want to get
instance.a == 'lemon'