[javascript-dev] Re: RE: JSUI : question about Array index/value
Emmanuel Jourdan
c74-mailinglists at e--j.com
Wed Oct 3 08:59:30 MDT 2007
- Previous message: [javascript-dev] Re: RE: JSUI : question about Array index/value
- Next message: [javascript-dev] Re: JSUI : question about Array index/value
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 3 oct. 07, at 16:46, simon adcock wrote:
> That's odd. Just incase you're looking at the forum view not the
> email list here's the js code again with out the bits missing... ?!
>
> var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"];
>
> function ratio(a)
> {
> for(i=0; i<Ratio.length; i++)
> {
> if(Ratio[i] == a)
> {
> outlet(0, i);
> }
> }
> }
One small thing, don't forget to declare the "i" variable with the
var keyword, otherwise it becomes global.
ej
- Previous message: [javascript-dev] Re: RE: JSUI : question about Array index/value
- Next message: [javascript-dev] Re: JSUI : question about Array index/value
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
