Js Sort Json Array Javascript Iteration