Follow my code,
Apple is define function by prototype.
Banana is define function by class property.
var Apple = function(){}
Apple.prototype.say = fu
prototype members are like class membeprototype members are like class member, while when u define it other way its not a class member. So if you are creating lot of object of Apple all will be sharing same function, while in case of banana, every object will have their own copy of function. Think prototype in javascript as static in C#.