javascript check if object is array