Bulk Manipulation Of Queried Data in the runtime

Scenario:
I have a queried list of items. I would like to change the open status of all the items to false.
The runtime apparently does not support ‘const’ or ‘let’ so I cannot figure out how to loop this to change the status on all items to false as a single function.

Is this something better accomplished in a CC task or is there an example of doing this in the runtime?

@jdavidpugh In standard JourneyApps JS apps you can only use var, as you have seen, but you can declare a var outside of a function, inside of a function, or inside of a loop, and so depending on the scope you need you will be able to accomplish the same thing.

That is assuming your problem is with the scope of your JS variable as opposed to with the syntax required to loop through all the objects and update them.

Please share what you would have liked to do using const or let and I will gladly give you a JourneyApps JS equivalent just using var

@tielman In my particular code I will have a query of selected_items.
In a bulk close function I would like to set (selected_item.open = false) on all the items in the query.
Noob got lost LOL.