Jump to content

Recommended Posts

Posted

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.

Click the title or link to this article to view the video.

View the full article

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.