function Person(gender) {
this.gender = gender;
}
Person.prototype.sayGender = function()
{
alert(this.gender);
};
var person1 = new Person(\'Male\');
var gend
You are calling the function without the context of its object, so this will be the global object window, so the function alerts the value of window.gender, which is undefined.