Q. What will be the output of the below code?

Code:
function password(pass) {
for (i = 0; i < pass.length; i++) {
}
}

function name(pname) {
console.log("The value of i is "+i);
for (i = 0; i < pname.length; i++) {
}
}

password("54321");
name("John");
  • (A) 0
  • (B) 5
  • (C) undefined
  • (D) error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
226
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
82%
Success Rate