Google (if you are thinking of a pacman game) used a new HTML5 function that supports a kind of "threading" called WebWorkers . You can also use timeouts, etc., to pretend to use streams, although this is actually not the case.
Writing a game in Javascript is similar to how you did it in C. Or rather messy C with most things in one file. You just need to define all your components in one javascript file (or several if you use WebWorkers) and click go. Graphics are mostly done using HTML5 canvas 2d, or if you're really on the verge of a canvas 3D canvas 3D system, which is not yet properly supported in all modern browsers.
In fact, you can create a game by simply setting one large Canvas width and height to 100%, and then program your entire system in this javascript file, ignoring the fact that you are on the Internet (if you want). Most common graphics, streaming, databases, networks, etc. The game's standard features are already built into the latest HTML 5 specification.
source share