Typescript Exit Foreach In C