|
-
Jan 18th, 2006, 01:43 PM
#1
Thread Starter
Fanatic Member
push()
I tried to add more names to the array but....
VB Code:
<script language="JavaScript">
var names=new Array("Tom", "Dan", "Liz", "Jody");
document.write("<b>Original array: "+ names + "<br>");
for (x=1;x<=5;x++)
{
var isim=prompt("....","....")+x;
}
names.push(isim(x));
document.write("New array: "+ names + "</b>");
</script>
-
Jan 18th, 2006, 04:19 PM
#2
Frenzied Member
-
Jan 18th, 2006, 04:49 PM
#3
Re: push()
But you put the push outside the loop, use () instead of [] for array indexing, and try to use as an array what isn't. Not to mention that you have scoping problems.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|