//Extending an existing object
function yourMethod(){
//statements
}
//Attach it to the String Object
String.prototype.methodName=yourMethod;
//Usage
var myVariable = "My String Here!"
myVariable.methodName();
//Extending a custom object
//Create custom object
function myObject() {
//statements
}
//Create custom method
function customMethod(){
//statements
}
//Create custom property
function customProperty() {
//statements
}
//Attach the property and method
myObject.prototype.methodName=customMethod;
myObject.prototype.prpertyName=customProperty;