Lượng Tiger
New member
What will be the output of the following JavaScript code?
A. Rahul 30000
B. Rahul
C. Rahul 45000
D. 45000
Code:
function emp(name,salary)
{
this.name=name;
this.salary=salary;
this.changeSalary=changeSalary;
function changeSalary(otherSalary)
{
this.salary=otherSalary;
}
}
e=new emp("Rahul",30000);
e.changeSalary(45000);
document.write("e.name+" "+e.salary);
B. Rahul
C. Rahul 45000
D. 45000