I'm taking Javascripting this semester, and I've been stressing out about this one program for over a week. I'm just *not* getting it. It was due on Sunday, and I totally blew through the deadline, and I've been meaning all week to write my professor to apologize and ask if I can get some more help with this. "Just explain it to me like I'm
(
Read more... )
Comments 4
(The comment has been removed)
I don't have my book with me, so I'm strangling the syntax, but the script is sort of like this:
----------------
var namelist = new Array
var name = prompt("Type a name.")
function feckingworkalready()
{
if (name) is (any series of characters)
{
1. add it to the "namelist" array in such a way that it can be found again.
2. ask the user for another name
3. repeat the loop
}
if (name) is "exit"
{
1. stop asking for names
2. go on to the rest of the script (break)
}
namelist.sort()
document.write("Here's your list." + "< br >")
document.write(namelist + "< br >")
------------
The first bit is giving me trouble. I can make it work if I populate the array beforehand (var namelist = new Array("Aragorn", "Gandalf", "Frodo") ), and I can figure out how to put one value in the array, but I can't work out how to make it 1. repeat and 2. find the names again to sort them.
Reply
Reply
(The comment has been removed)
Reply
Reply
Leave a comment