Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Development
HTML and CSS
Reversing output of user input by using while loop...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="MeMate, post: 5171302, member: 89924"] I don't know exactly what you are trying to do there but a while loop works like this [code] var array=new Array('Apple','Peach','Pear','Berry'); var num=array.length; while(num>0){ console.log(array[num-1]); num--; } [/code] Same thing with a for loop [code] var array=new Array('Apple','Peach','Pear','Berry'); var num=array.length; for(i=num; i>0; i--){ console.log(array[i]); } [/code] [/QUOTE]
Verification
Post reply
Forums
Development
HTML and CSS
Reversing output of user input by using while loop...
Top