Javascript Remove First Element From Array And Its Types