While using JavaScript forEach loop at the time of execution the next line will be executed abnormally what to do??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

While using JavaScript forEach loop at the time of execution the next line will be executed abnormally what to do???

3rd Jul 2020, 2:22 PM
Rajesh Dehury
Rajesh Dehury - avatar
3 Answers
+ 5
Rajesh Dehury It sounds like you are attempting to use the Array.forEach() method and are running into an error. After unsuccessfully attempting to figure out how to resolve this issue on your own, you've decided to post this question. While the context of the problem might be clear to you, you forgot to provide the details in your question for everyone else. 😉 I'm bringing this up because I believe that many beginners struggle with effectively and clearly breaking down the details of describing their code. Furthermore, it's even more difficult for these beginners to describe the issue they are having and providing proper context of the problems. I believe this skill of being able to clearly and effectively articulate the issues will not only help in searching for the solution, but more often than not, reveal the solution on its own in the process. This is a core skill to continue developing and refining as it will be a powerful catalyst for growth. Best of luck in your journey.
3rd Jul 2020, 3:25 PM
David Carroll
David Carroll - avatar
+ 3
What do you mean by abnormally? A forEach loop takes a function as a parameter to be passed in each of the iterable's elements. I don't see anything abnormal about it. Are you just wondering how forEach loops work?
3rd Jul 2020, 2:56 PM
Zeke Williams
Zeke Williams - avatar
+ 3
Do you mind showing that piece of code that is working abnormal?
3rd Jul 2020, 2:59 PM
Raj Chhatrala
Raj Chhatrala - avatar