Ah I'm sorry I understood you wrong. I thought you meant skipping an element like continue. You meant completely stop after a certain element. This is currently not possible with forEach, but you could use for (obj of array) or some instead to achieve that behavior
Sorry again for the misunderstanding
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ah I'm sorry I understood you wrong. I thought you meant skipping an element like continue. You meant completely stop after a certain element. This is currently not possible with
forEach
, but you could usefor (obj of array)
orsome
instead to achieve that behaviorSorry again for the misunderstanding