• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
0

How does this [1,2].forEach(alert) ?

[1,2].forEach(alert); This will alert 1 2 but how does it take array of elements.please explain

javascript
2nd Mar 2022, 11:29 AM
Bhavani Sankar
Bhavani Sankar - avatar
1 Answer
+ 5
It just does, so https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
2nd Mar 2022, 12:16 PM
Simba
Simba - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Question
2 Votes
Hi guys I need some one to teach the String name how I can do it true because when I finish coding they give me NO OUTPUT
2 Votes
generic programming understanding memory ownership
0 Votes
Wayss
0 Votes
I dont now that how to do js
2 Votes
fully dynamic arrays
1 Votes
overloading operators << >>
1 Votes
Project subjection
0 Votes
Wishkit alternative for android
1 Votes
How to start in web dev?
0 Votes