Skip to content
Advertisement

Foreach last item gets methode

Guys I have an array with objects, I want the last item in the foreach loop do something else then the rest. How do I archive that?

JavaScript

Advertisement

Answer

This will process the array of objects and do something else with the last element:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement