Need help listing a row of lottonumbers using an Array.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   c_finster
Posted On:   Friday, January 24, 2003 01:54 PM

Lottozahlen var lotto = new Array (6); lotto[0] = 9; lotto[1] = 15; lotto[2] = 33; lotto[3] = 34; lotto[4] = 42; lotto[5] = 46; //--> ]]>]]> I´m an absolute beginner when it comes to JavaScript. I´m trying to do something basic, but I can`t seem to get it right. I´m trying to list 6 Lottonumbers on the screen with an array. I have the Array finished but I´m nit sure how to make the numbers show in order.  I want a comma to separate the numbers and a period after the last number. This is what I want to see on the screen: The lotto numbers are: 9, 15, 33, 34, 42, 46. I have included what I have so far:    More>>
Lottozahlen



I´m an absolute beginner when it comes to JavaScript.

I´m trying to do something basic, but I can`t seem to get it right.

I´m trying to list 6 Lottonumbers on the screen with an array.

I have the Array finished but I´m nit sure how to make the numbers show in
order.

 I want a comma to separate the numbers and a period after the last number.



This is what I want to see on the screen:



The lotto numbers are: 9, 15, 33, 34, 42, 46.



I have included what I have so far:





















The Lotto numbers are:







 


In the body, I have included question marks where I am stuck at.



I would really apreciate a tip ( or maybe the answer).

I tried looking in the web, but I couldn´t find anyplace that could explain how
to solve my problem.



thanks from germany . greetings cfinster@web.de

   <<Less

Re: Need help listing a row of lottonumbers using an Array.

Posted By:   Jeanne_Boyarsky  
Posted On:   Friday, January 24, 2003 04:28 PM

First of all, the second "var lotto" is redundant. It will override the array you have declared above, causing the array to always be null. As I don't see "i" defined, you may have meant "var i=0;"


So plugging into your code, we have:

The Lotto numbers are:



p.s. - A good javascript reference is:
http://developer.netscape.com/docs/manuals/communicator/jsref/index.htm
About | Sitemap | Contact