I usually test JavaScript outside CA-RA, then copy it back in once working (e.g. JavaScript Tester online). To make this easier, I will start my script by assigning the input values to variables that are then used in the script. For example, if I know that input1 and input2 will be used in my script, rather than use then directly in the logic, I will code this at the top:
var myvar1 = input1;
var myvar2 = input2;
(Obviously I use more meaningful names than myvar1 and myvar2)
Then I reference myvar1 and myvar2 in my code. What this means is that in the JS testing tool, I can declare and provide values to input1 and input2, but I leave those lines behind when I copy into CA-RA (or I may bring them over as comments to make continuned testing easier).
Doing this, I can validate my JS code is doing what it is supposed to without the need to have everything in CA-RA initialized.
Hope this helps...