Inheritance in JavaScript can be implemented using constructors, prototypes, and the Object.create() method. For example:
function Dog(name) { Animal.call(this, name); }
promise.then((data) => { console.log(data); }).catch((error) => { console.error(error); });
function Animal(name) { this.name = name; }
Dog.prototype = Object.create(Animal.prototype); Dog.prototype.constructor = Dog;