ForEach Function for Scripted Loops
When it comes to doing the same thing over and over again, you really can't beat a loop. It's the wet side of DRY (Don't Repeat Yourself), where the "Don't" turns into a very big "Please, yes, DO."
The trick with loops, especially when you're processing a lot of data like JSON, is that you often have to manage multiple iterators, counts, and all the little bits and pieces needed for a successful outcome.
One of the wonderful things about many other languages, like Python, PHP, JavaScript, and others, is they offer really nice structures like forEach(). Well, we can have the same thing too! Things may not be as ideal as they are in those languages, but we can definitely enjoy some added code clarity and convenience - making it that much easier to work with loopable data.
In this video, I showcase an updated version of a convenience function for working with both simple lists and JSON arrays. It’s a great way to handle intra-script parameters and makes your code much easier to read.