Javascript Array Remove Last Element From List