title: Accessors are only available when targeting ECMAScript 5 and higher
body: <p>I am trying to run this code but it is giving me following errors:</p>
  
  <blockquote>
    <p>Animal.ts(10,13): error TS1056: Accessors are only available when
    targeting ECMAScript 5 and higher. Animal.ts(14,13): error TS1056:
    Accessors are only available when targeting ECMAScript 5 and higher.</p>
  </blockquote>
  
  <pre><code>interface IAnimal{
      name : string;
      sayName():string;
  }
  
  class AnimalImpm implements IAnimal{
      private _name : string = '[Animal]';
      get name():string{
          return this._name;
      }
  
      set name(name:string){
          this._name = name;
      }
  
      constructor(name:string){
          this.name = name;
      }
  
      sayName():string {
          console.log(`My name is ${this.name}`);
          return "Hello";
      }
  }
  </code></pre>