I explore the deep end of JavaScript.
Well, let's say I have a constructor function like this. Yes, I know this is a weird way of creating a constructor function, but ...
function Animal(name){
return { name };
}
And I wanna add a prototype property like walk(), but it doesn't work here. I know it looks stupid, but...
Animal.prototype.walk = function () {
console.log(`${this.name} is walking ...`);
}
QUESTION: Is there any way that I can add this walk property as a prototype property?