How to detect if a user is online

How to detect if a user is online

Many browsers have implemented events “online” and “offline”; in addition to this, browsers also expose the navigator.onLine property that will return “online” or “offline” How many browsers is many? caniuse says every major browser (Chrome, Firefox, Safair, IE11…) except Opera mini has this functionality (as of July 4th 2018). How can I check the online status? > navigator.onLine…

This post is not about Backbone

We’re gonna talk about video games. Imagine you’re playing Mario Kart on a four person split screen. There are four Yoshis on the screen for each player. How many Yoshis should we model? The obvious answer is four: there are four Yoshis on the screen, so there must be four Yoshis. The problem is that this answer misses…