|
-
Nov 14th, 2002, 03:51 PM
#1
Thread Starter
Lively Member
array help?!?!
this is strange!!?!?
WHY does the star[0,0] value change on every loop?!?!
<script>
star = new Array()
for(n=0; n<=3; n++){
star[n,0] = Math.round(Math.random() * 100)
alert(star[0, 0])
}
</script>
-
Nov 14th, 2002, 09:56 PM
#2
Addicted Member
You are calling on and assigning values in a multideminsional array. But you have only instantiated a single deminsional array.
Travis, Kung Foo Journeyman
Web Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.5 Guide and Reference
Perl: Documentation, Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
OSS: Mozilla, MySQL (Manual)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|