RunScript returning multiple values not always work

I found a way around this problem i think. I found this topic: Array in Katalon Recorder and i modify it a little bit to work in actual version of Katalon. And then i modifed it even more so i have two way to workaround this problem.

1 version:

runScript | var i = 1; var j = 2; var k = 3; |
storeEval | 0 | loop
while | ${loop}<=2 |
storeEval | array[${loop}] | element${loop}
storeEval | ${loop} + 1 | loop
endWhile

This version is good if you have a lot of values to store in Katalon from just one JS code.

2 version:

runScript | var i = 1; var j = 2; var k = 3; |
storeEval | array[0] | element0
storeEval | array[1] | el1
storeEval | array[2] | something

This is bettter if you want to give your vars diffrent names like shown in the example. It 's also easier to understand to people how are new in Katalon.