Understand this!

A

add

Can someone explain how this works? Thanks!

ProcessData( DataArray )
{

TheData = DataArray || [];
...
}


ProcessData(["Item1", "Item2", "Item3", "Item4"]);
 
R

Randy Webb

add said the following on 10/30/2005 9:43 PM:
Can someone explain how this works? Thanks!

ProcessData( DataArray )

That's a syntax error. It should be:

function ProcessData( DataArray)

Or:

myVar = ProcessDate( DataArray)
{

TheData = DataArray || [];

It checks to see if DataArray is an array. If it is, it sets TheData =
to that array. If not, it sets TheData to an empty array.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top