const fieldsToSend = _(["id", extra]).without("transition").uniq(); console.log(values.filter(isValid).map(extractId).slice(-5, -1));