Typescript String Functions In Javascript