Disclaimer: I don't want to use constructors and I don't want to use the keyword new. I want to do this all with Object.create.
Here is the code I have, that works perfectly fine:
var vectorPrototype = {
x: null,
y: null
}
var v1 = Object.create(vectorPrototype) // line 6
v1.x = 1
v1.y = 1
console.log(v1);
// { x: 1, y: 1 }
What I would like to do, is create a new object and pass in x and y all in one line. Is this possible?