I'm trying to get my head around this Object.create thingybob. I can't find a use for it right now. I'm quite early in my JS coding but I'm struggling to grasp the concept of it. To me it just seems to over complicate the code a whole lot. Could someone explain it to me like I'm a five-year-old?
I have read these articles here: JavaScript inheritance: Object.create vs new
What is the 'new' keyword in JavaScript?
Understanding the difference between Object.create() and new SomeFunction()
Using "Object.create" instead of "new"
But it doesn't do it for me. If I have this code what would it look like as an Object.create and how could it be called upon?
function Player (name, stopAtValue) {
this.name = name
this.stopAtValue = stopAtValue
}
let player = new Player('John', 16)