Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Reverse a string</title>
- <script type="text/javascript">
- originalString = prompt("What do you want to be reversed?")
- reversedString = []
- for(i=1; (originalString.length - i) >= 0; i++)
- {
- reversedString.push(originalString[originalString.length - i])
- }
- alert(reversedString)
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement