Sort An Array Based On Another Array Methods In Js Mdn For Loop