Sort Array By String Property Javascript Foreach