If you need to add and subtract the value of a checkbox on the checkbox click,try the code below.Hope this is what you meant.
var allVals = [];
$('input:checkbox[name=addons]').each(function() {
allVals.push($(this).val());
});//Gets the complete List of values
//Adds and subtracts the value on click
var curr_value=0;
$("input:checkbox[name=addons]").on('click',function() {
if($(this).is(":checked") == false){
curr_value = curr_value -$(this).val();
}
if($(this).is(":checked") == true){
curr_value = curr_value + +$(this).val();
}
alert(curr_value);//Contains the added values of the checked boxes
});