Message from JavaScript discussions

October 2017

— 

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

— 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

— Uhm, you can't pass snakes through sockets like that

— Socket.io doesn't work with anything other than JSON objects

— Aka no instances, functions, etc

— Uhm

— You could solve it by having an alternative class on the server I guess