Loading an array object will null value

Use this board to ask questions or have discussions with other Profound.js users.
randyh
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:

Loading an array object will null value

Post 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]
Scott Klement
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

Post 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.
randyh
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

Post by randyh »

Scott

Thanks you it's working now
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests