I am not quite sure how prototype works in JavaScript. I heard that it is an internal property of a function. Buy it is still an vague concept to me. Can we define it.

I hope that somebody uses the following example to illustrate it.

Code:
function BinarySearchTree() {
    this._root = null;
}

BinarySearchTree.prototype = {

    //restore constructor
    constructor: BinarySearchTree,

    add: function (value){
    },

    contains: function(value){
    },

    remove: function(value){
    },

    size: function(){
    },

    toArray: function(){
    },

    toString: function(){
    }

};
Can we move add, contains etc out of it to create separate functions?