Though you'll see a lot of older style callback code, please utilize modern JavaScript. ES6 classes, arrow functions, and builtins.
There is almost never a reason to use var
. Prefer const
where you can and and let
otherwise.
Save with UNIX line feeds, UTF-8 without BOM, and tabs set to 4 spaces.