+ 1
How do you create a function that is attatched to an object like in the example document.write();
2 Answers
0
Ver obj;
Obj.func = function() {}
0
1.
var obj = {};
obj.func = function() {}
2.
function Fruits(){}
Fruits.prototype.getFruitsA = function(){}
var fruits = new Fruits();
fruits.getFruitsB = function(){}
getFruitsA();
getFruitsB();