= name; 4 } 5 6 describe() { 7 return 'Human name is ' + this.name; 8 } 9 } 10 11 let h = new Human('Luiz'); 12 console.log(h.describe()); // Human name is Luiz
{ 3 super(name); 4 this.favoriteLanguage = favoriteLanguage; 5 } 6 7 describe() { 8 return `${super.describe()} and its favorite language is ${this.favoriteLanguage}`; 9 } 10 } 11 12 let d = new Developer('Luiz', 'JavaScript'); 13 console.log(d.describe()); // Human name is Luiz and its favorite language is JavaScript
2 return x+y; 3 } 4 5 var sum = function (x, y) { 6 return x + y; 7 }; 8 9 let plusOne = x => x+1; 10 11 var plusOne = function (x) { 12 return x + 1; 13 };