A

Admin • 828.03K Points
Coach

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]
  • Correct Answer - Option(B)
  • Views: 8
  • Filed under category JavaScript
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.