javacript array question

Paul Seamons paul at seamons.com
Wed Aug 17 08:27:45 MDT 2011


> - javascript does not support associative array
> - array must have all variables from same kind
> try this
Um - no.  That would be wrong.  The following are perfectly valid 
javascript (though technical JSON requires keys to be quoted).

var start   = ['foo', 23, 'bar', [1,2,3]];
var start2 = {foo: 23, bar: [1,2, {baz: '3}]};

Paul



On 08/16/2011 03:53 PM, hatem gamal elzanaty wrote:
> - javascript does not support associative array
> - array must have all variables from same kind
> try this
>
> var start= array( 32.5, -97.2, 10 );
> var start2= array( 't1', 't2' );
>
>
> print start[0] ;
>
> then make a loop to print array items
>
>
> see this site
> http://www.w3schools.com/js/default.asp
>
>
> thanks read about arrays
>
> hatem gamal
>
> Merrill Oveson wrote:
>> Here's the solution:  print "start( [32.5], [-97.2], ['10'],
>> ['Merrill'], ['Non-Exempt'] )";
>>
>> On Tue, Aug 16, 2011 at 4:02 PM, Joshua Lutes<joshua at lutes.me>  wrote:
>>
>>> Does a trailing comma after the single string make it work?
>>>
>>> Joshua.
>>>
>>> /*
>>> PLUG: http://plug.org, #utah on irc.freenode.net
>>> Unsubscribe: http://plug.org/mailman/options/plug
>>> Don't fear the penguin.
>>> */
>>>
>>>
>> /*
>> PLUG: http://plug.org, #utah on irc.freenode.net
>> Unsubscribe: http://plug.org/mailman/options/plug
>> Don't fear the penguin.
>> */
>>
>>
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>



More information about the PLUG mailing list