I have an object I'm trying to set a property to. However, I'm getting the type error Uncaught TypeError: Cannot set property 'meh' of undefined
.
I'm trying to set this property using prototype.
greenify = {
color: function(){
console.log("Turned green");
}
};
greenify.prototype.meh = function(){
console.log("Off");
}
console.log(greenify);
Can anyone explain why it's claiming the greenify object is undefined and how to fix it?