This error (or at least, your interpretation of the error) does not make sense. Something else is undefined.
It does not make sense, because in JavaScript, unless the object is sealed or extensions are disallowed (Object.seal and friends), setting a value to a previously undefined property simply creates that property and sets its value to the value you specify.
Like -
var blankObject = {};
blankObject.newProperty = "bla"; // This does not throw, it sets a new property.
What is the exact error you get?
By the way, when I run this code, I get no error and see two players.