moment.js

Using global variables in JavaScript is not commonly considered a good practice.

Besides these constraints, in web development, every user has access to the Window (or global) object. By putting variables on the global scope, you give any user the ability to see or change your variables.