vibespolew.blogg.se

Java script game
Java script game







java script game

What is often called "the getElementById() function" for short is really the "getElementById" key in the "document" variable, which is an object, containing that key among others. which is how you get stuff like "document.getElementById()". In JavaScript, an object is a little like the Map template of C++ or JAVA - you have key/value pairs, but the difference is that different values can be of different types, and one of these types can be a function.

java script game

What state are we talking about? The state within a page? The state across pages (including page refreshes) on the same device and browser? Or the state across devices, browsers, refreshes per user?The state within a page can be kept within a single JavaScript object, which is the closest you can get to a singleton.









Java script game