Edit in JSFiddle

// Helper function 'create'
if (typeof Object.create !== 'function') {
    Object.create = function (o) {
        function F() {} // create a new object
        F.prototype = o; // set it's prototype to the passed object
        return new F(); // return the new object
    };
}

// define object 'Person'
var Person = {
    sayHello: function () {
        alert('Hello there.');
    }
};

// define object 'student1' using our helper function 'create'
var student1 = Object.create(Person);
// Now object 'student1' has inherited all properties from object 'Person'

// Define new properties related to student1 Object
student1.codeWith = function (code) {
    alert('I code with ' + code);
};
student1.sayHello();
student1.codeWith('JS');

// change base object implementation for 'sayHello' function
student1.sayHello = function () {
    alert('hello I am a Student Object');
};
student1.sayHello();