This is for some homework of mine. Javascript has thus so far been the most difficult for me to grasp. Here's a copy of my assignment:
Copy the following code into new file.
<html>>
<body>
<script>
var namIn = window.prompt("Enter Senator’s State and FULL Name, separated by space:" );
var namAr = namIn.split("");
var namArLen = namAr.length;
document.write(namAr + "<br /> Length:" + namArLen);
</script> </body>
</html>
When you execute this code you will see that after you entered your name it was loaded into namAr array. Your output will look like this:
C,o,l,o,r,a,d,o, ,M,a,r,k, ,U,d,a,l,l
Length: 19
Your task: Add a small iteration that will display your name in reverse order. For example if senator’s state and name as I entered as:
Colorado Mark Udall
your output will be
C,o,l,o,r,a,d,o, ,M,a,r,k, ,U,d,a,l,l
Length: 19
lladU kraM odaroloC
I'm trying to achieve the bold part. They check our coding. I'm not looking for an answer as much as I am a sort of walkthrough or explaination. Anything help, thanks!
RESOLVED Figured it out, thanks! All great answers- you guys are so smart!