node.js - How do I re-arrange how my loop works? -


i working on message board , want new topics first in line. using foreach loop print out topics new ones going under old ones. how fix this?

my foreach code

<% threads.foreach(function(thread){ %> "><%= thread.subject%>
posted by:

-

you can use reverse

<% threads.reverse().foreach(function(thread){ %> "><%= thread.subject%> 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -