Q. Which one of the following options is the correct output for the given code of JavaScript?

Code:
function code(id,name)  
{  
        this.id= id;  
        this.name= name;  
}  
functionpcode(id,name)  
{  
        code.call(this,id,name);  
}  
document.writeln(newpcode(004,"James Deo").id);
  • (A) James Deo
  • (B) compilation error
  • (C) runtime error
  • (D) undefined
πŸ’¬ Discuss
βœ… Correct Answer: (A) James Deo

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
215
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yashika
Publisher
πŸ“ˆ
89%
Success Rate