Getting syntext error while define a class with private member

Actually it seems that your code is already in TypeScript (or at least the one that you pasted), so you will have to convert it to JavaScript. If you want to use the current code in a JavaScript project (acknowledging that it’s an invalid JavaScript code) then you have to made modifications to your build process to allow it. Check out the linked post for more details on how exactly to do it: