I'm just started with JavaScript oops concept , I want to access 3 instance variable from a constructor with out 'this' keyword, First value is coming but not 2nd.. and so on .. `
function CreateObject()
{
var p1 = new person('chanky',25,'Male');
}
function person(name,age,sex)
{
this.name = name;
this.age = age;
this.sex = sex;
document.write(name); //Working
document.write(age); //not Working
document.write(sex); //not Working
/*If we use 'this' keyword then all are Working */
document.write(this.name); // Working
document.write(this.age); // Working
document.write(this.sex); // Working
}`
name,age,sex), this is not the same