I am working on a project whereby i have noticed there are multiple references to the same objects in different areas. But i have been reading on mixins and just prototypal inheritance but not sure which one to follow:
So my current objects look like below but i need for product to inherit the base class including the function which is used everytime.
var base = function() {
this.id = 0;
this.refererer = null;
this.getCurrency = function() {
return "US"
}
}
var product = function() {
this.name = "";
this.description = "";
}
How can i implement the above to use either mixins or prototypal inheritance?