Order by Sort Javascript -



Order by Sort Javascript -

can help me? ... have array in javascript , need order ascending, problem ... need order first number ... "-" left ....

this arrya ...

["20140615-http://localhost:8080/proyecto/upload/orbthzk/image_orbthzk.gif", "20140617-http://localhost:8080/proyecto/upload/orbithcity/image_orbithcity.png", "20140601-http://localhost:8080/proyecto/upload/423445/image_423445.gif"]

and need ...

["20140601-http://localhost:8080/proyecto/upload/423445/image_423445.gif", "20140615-http://localhost:8080/proyecto/upload/orbthzk/image_orbthzk.gif", "20140617-http://localhost:8080/proyecto/upload/orbithcity/image_orbithcity.png"]

strangely enough, calling sort() on array works fine. here's re-create of did in node console:

var arr = ["20140615-http://localhost:8080/proyecto/upload/orbthzk/image_orbthzk.gif", "20140617-http://localhost:8080/proyecto/upload/orbithcity/image_orbithcity.png", "20140601-http://localhost:8080/proyecto/upload/423445/image_423445.gif"]; arr.sort() [ '20140601-http://localhost:8080/proyecto/upload/423445/image_423445.gif', '20140615-http://localhost:8080/proyecto/upload/orbthzk/image_orbthzk.gif', '20140617-http://localhost:8080/proyecto/upload/orbithcity/image_orbithcity.png' ]

might different depending on environment, it's supported in node major browsers. if you're targeting old/edge case browser ymmv.

javascript

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -