Let\'s say I have an array: [0,3,4,2,5,1].
[0,3,4,2,5,1]
What I want to do is sort an array such as:
[\"one\", \"two\", \"three\", \"four\", \"five\",
Not sur how you get your first array, but you could use an array of objects instead of [0,3,4,2,5,1]:
var arr = [ {n:0, s:'one'}, {n:3, s:'four'}, {n:4, s:'five'}, {n:2, s:'three'}, {n:5, s:'six'}, {n:1, s:'two'} ]
And avoid to process it.