Typescript Sort Function In Javascript Onclick