I am trying to run this code but it is giving me following errors:
Animal.ts(10,13): error TS1056: Accessors are only available when targeting ECMAS
Here you need to pass the switch to type script compiler, so it target ECMAScript file. To do that enter below code in the terminal
tsc (your ts file).ts --target ES5 and run your bulid js file node (your js file)
tsc (your ts file).ts --target ES5 and run your bulid js file
node (your js file)