Page 1 of 1
Loading an array object will null value
Posted: Wed Jun 30, 2021 12:59 pm
by randyh
What is the simplest way to load an array with null values, my js module keeps returning this the word array inside the []?
hazmatInfo: [Array]
Re: Loading an array object will null value
Posted: Wed Jun 30, 2021 2:43 pm
by Scott Klement
Are you simply trying to load a JavaScript array with nulls? Its not clear why someone would want to do that, but you could do something like this:
var myArray = [];
for (var i=0; i<100; i++) myArray.push(null);
That loads the first 100 elements of the array with null. Is that what you want? I'm not completely sure what you're trying to do or why.
Re: Loading an array object will null value
Posted: Thu Jul 01, 2021 2:22 pm
by randyh
Scott
Thanks you it's working now