First of all, you created an instance of Employee before you set up the prototype so that the object does not inherit the new prototype values.
Further, any objects created after you installed the prototype inherit the new prototype object.
Finally, the object will have the isWorking property, not the working property.
So, repeat your example:
function Employee(name) { this.name= name; }; var m1 = new Employee("Bob"); var working= { isWorking: true }; Employee.prototype = working; var m2 = new Employee("Sam"); alert(m1.isWorking);
source share