Archived

This topic is now archived and is closed to further replies.

MrDude21

help in Javascript

Recommended Posts

hey u guys, im only 12, so dont laff cuz im stupid, but i have a question in java-script. i wanted to know how i can find the value of the highest number in an array (how many there are) from an array which is made by the .split() method splitting a string of user input. if anybody can help, that wuld be great. thanks a lot! ~Andy

Share this post


Link to post
Share on other sites
quote:
Original post by MrDude21
hey u guys, im only 12, so dont laff cuz im stupid, but i have a question in java-script. i wanted to know how i can find the value of the highest number in an array (how many there are) from an array which is made by the .split() method splitting a string of user input. if anybody can help, that wuld be great. thanks a lot!

~Andy


Try searching on Web Developers sites instead of on a game programming site.. You might want to try: www.webmonkey.com

"And that''s the bottom line cause I said so!"

Cyberdrek

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer
/(bb|[^b]{2})/ that is the Question -- ThinkGeek.com
Hash Bang Slash bin Slash Bash -- #!/bin/bash

Share this post


Link to post
Share on other sites
MrDude21, arrays in java-script actually use the length property, which counts the number of indexes:

myarray=new Array(5);
myarray.length; //this evaluates to 5

Since arrays are objects, you can expect to use some of the usual object methods, and also properties, as long as those properties are numeric (length is the only one I can think of).



Share this post


Link to post
Share on other sites
cool, thanks u guys. i wuz thinking of using the array.length() but i dint know if it wuld work. next time, ill just try it out first. thanks again! bai

~Andy

Share this post


Link to post
Share on other sites