Consider following code snippet?

$.each([1,2,3], function() {
  document.write(this + 1);
});
What will be printed to the page?
Explanation
The each() method specifies a function to run for each matched element. In our code example, the each() method iterates through an array [1,2,3] and print it's elements + 1 to the page.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
JavaScript quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes