πŸ“Š JavaScript
Q. Which one of the following options is the correct output for the given code of java script?
Code:
var sum=0;  
   
vararr=[101,150,201,30];  
   
arr.forEach(functionmyFunction(element)  
{  
    sumsum=sum+element;  
});  
document.writeln(sum);  
  • (A) 70
  • (B) 75
  • (C) 482
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 482

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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