Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

javascript inline scripts should raise an exception when attempting to use undefined vars

edited May 2020 in OSWeb

I just used the array.splice method to insert a string into an array of strings like so:

var myArray = ['first', 'second', 'third'];
myArray.splice(2, 0, vars.myString);

vars.myString was not defined so what I ended up with is ['first', 'second', None, 'third'] instead of a four string array.


Would it not make more sense if OS raises an exception if a variable is not defined?


Cheers,

M

Sign In or Register to comment.