Q. What will be printed in the console on execution of the following JS code:

Code:
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
var myArr= array.filter(v => v % 3 === 0);

console.log(myArr);
  • (A) myArr
  • (B) [3, 6, 9, 12, 15]
  • (C) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  • (D) [1, 2, 4, 5, 7, 8, 10, 11, 13, 14]
πŸ’¬ Discuss
βœ… Correct Answer: (B) [3, 6, 9, 12, 15]

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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