So I'm trying to wrap my head around the different ways to create an object.
I came accross the Protoype pattern for creating objects.
Now I wrote two functions below but I can't see what the functional difference between both would be? When would you use the Constructor pattern and when would you use the Prototype pattern?
Constructor Pattern
function Fruit(){}
Fruit.color = "Yellow",
Fruit.fruitName = "Banana",
Fruit.nativeTo = "SomeValue"
Prototype Pattern
function Fruit(){}
Fruit.prototype.color = "Yellow",
Fruit.prototype.fruitName = "Banana",
Fruit.prototype.nativeTo = "SomeValue"