Remove First And Last Element From Array Javascript