Is it like...
var obj = new Object();
obj.function1 = function(){
//code
}
or something like that?
Generally use the prototype property:
function YourObject()
{
//
}
YourObject.prototype.yourMethod= function()
{
//
}
One thing I haven't seen anyone mention yet is why you might want to use the prototype property over, say, object-literal notation: doing so ensures the function definition gets shared across all instances of the objects created from your function prototype, rather than once per instantiation.