Javascript Check Type Of Variable Is Arraylist