Javascript Check If Array Of Pointers With Example