# general


06/04/2019, 10:44 AM
I'm having an issue where I'm iterating over an array using for-of, instantiating a set of resources per iteration (resourceA, resourceB). An output value from resourceA is used for resourceB, but the output of resourceA.outputValue.apply() always returns the output of resourceA in the last iteration - for all iterations (as if the variables that hold references to the resources are overwritten each iteration, and the last value is used for all resources. If I instead of referring to variables created in the for-of iteration, push the instantiated resources to an array and do a resources[i].outputValue.apply(), everything works as one would expect. Is this a bug, or intended behavior?