Typescript Unique In Array Javascript Function Definition Is Not Allowed