Message from JavaScript discussions

October 2017

— Thanks

— 

For(var key in socketList){
//WORK
console.log(socketList[key].snake.name);
//DOESN'T WORK: move is not a function
socketList[key].snake.move();
}
But move() exists, why it doesn't work?

— How?

— The vars are ok: snake.name works, snake.move() don't

— If JS says it's not a function, it's not a function

— 

console.log(socketList[key].snake);
console.log(typeof socketList[key].snake.move);
console.log(socketList[key].snake.move);

Message permanent page

— Console.log(typeof socketList[key].snake.move); // undefined
console.log(socketList[key].snake.move); // undefined

Message permanent page

— Https://hastebin.com/axumosozop.js

— Yeah, seems like they're not inheriting properly

— Does the prototype get overriden / do you assign to snake.move?

— No https://hastebin.com/tomavapali.js

— Oh god wha