Normally the variable inside the loop was carried over after the loop and can be used anytime you like in any line of the code after the loop but not in hubspot. After the loop all variable inside it, is still undefined outside.

Normally the variable inside the loop was carried over after the loop and can be used anytime you like in any line of the code after the loop but not in hubspot. After the loop all variable inside it, is still undefined outside.