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]
Loading an array object will null value
-
- Profound User
- Posts: 21
- Joined: Mon Dec 15, 2014 5:21 pm
- First Name: Randy
- Last Name: Heinz
- Company Name: Southwestern Motor Transport
- Phone: 210.662.3272
- Address 1: 4600 Goldfield
- City: San Antonio
- State / Province: Texas
- Zip / Postal Code: 78218
- Country: United States
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Loading an array object will null value
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.
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.
-
- Profound User
- Posts: 21
- Joined: Mon Dec 15, 2014 5:21 pm
- First Name: Randy
- Last Name: Heinz
- Company Name: Southwestern Motor Transport
- Phone: 210.662.3272
- Address 1: 4600 Goldfield
- City: San Antonio
- State / Province: Texas
- Zip / Postal Code: 78218
- Country: United States
- Contact:
Re: Loading an array object will null value
Scott
Thanks you it's working now
Thanks you it's working now
Who is online
Users browsing this forum: No registered users and 4 guests