This is a functions which creates new object. This function is neither a constructor function, nor a "class".
function createPerson(name) {
let person = {};
person.name = name;
return person;
}
const canWalk = {
walk() {
console.log(`${this.name} is walking.`);
}
};
function createWalkingPerson(name) {
let person = {};
person.name = name;
return Object.assign({}, canWalk, person);
}