C++ style applying to javascript
-
Hi,
what is the difference between var Pong = {}, which is a declaration of an object ... found here: https://github.com/jakesgordon/javascript-pong/blob/master/pong.js
and function Level() {} is a function, but in this context it's intended to be used to create multiple instances of Level? found here:
http://eloquentjavascript.net/15_game.htmlCould you explain it with 2 examples? I'm used to object oriented programming in c++, but how to apply it to javascript?
Thanks,
MikeR
-