sorting a json array by one field during iteration using JS : I have an array as follows

    var array = {"week1":[{"id":1,"name":"x","mark":"20"},{"id":2,"name":"y","mark":"30"}],"week2":[{"id":1,"name":"x","mark":"40"},{"id":2,"name":"y","mark":"60"},{"id":3,"name":"z","mark":"10"}]}

I want to sort the array by mark field. How can I achieve this?