Q. Which of the following is the correct output for the following JavaScript code:

Code:
function display1(option)  
{  
    return(option ?  "true" :  "false");  
}  
    bool ans=true;  
console.log(display1(ans));  
  • (A) False
  • (B) True
  • (C) Runtime error
  • (D) Compilation error
πŸ’¬ Discuss
βœ… Correct Answer: (B) True

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
208
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akshay Kulkarni
Publisher
πŸ“ˆ
87%
Success Rate