adds a more robust method of checking for arrays

I did research online on the best way to check for arrays and it turns out that the jQuery library uses this method to check for arrays and is widely agreed to be the best way to check for arrays.