Typescript Get Last Character Of String Javascript Methods Syntax