Can I put data into an array at the moment I declare it?<br>I've tried this, but I get an error (missing ; )<br><br>var weekend[3] = {"friday","saturday","sunday"};<br>document.write(weekend[0]);<br>
try something like this:<br><br>var myArr=new Array(stuff,seperated,by,commas);<br><br>if you just want to set the maximum number of slots, use:<br><br>var myArr=new Array(numSlots);<br><br>//numSlots must be less than 99 <p>theEclipse<br><a href=mailto:eclipse_web@hotmail.com>eclipse_web@hotmail.com</a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.