Handling timezones with daylight savings in moment.js

Moment.js is a fantastic library for managing dates in Node.js or other javascript applications.  If you’re reading this article it probably means you’ve used moment.js before in your application, but if not, definitely give it a try.  This article will focus mainly on how to use timezones in your moment.js javascript application.

Read moreHandling timezones with daylight savings in moment.js

Check if a variable is an array in Javascript

Here’s a quick tip. When writing javascript and trying to test if a given variable is an array or not, I originally used the method of using the “typeof” operator. Unfortunately, because an array in Javascript is just another type of object, typeof will return “object” for an array variable.

So… instead, it’s recommended (by the people of the internet) that you use the “toString” method which will return a specific string for Array objects.  The following code demonstrates this:

Read moreCheck if a variable is an array in Javascript