Array.isArray is the build in javascript way to do this.