This way will let you add or remove values when you check or uncheck any checkbox named as options[]
:
var checkedValues = [];
$("input[name='options[]']").change(function() {
const intValue = parseInt($(this).val());
if ($(this).is(':checked')) {
checkedValues.push(value);
} else {
const index = checkedValues.indexOf(value);
if (index > -1) {
checkedValues.splice(index, 1);
}
}
});