Through my javascript library, I end up with a string that represents a number. Now I want to preform an addition on that number without it doing a string concatenation inst
For some reason.... who knows???
Using parseFloat works.... when parseInt does not... obviously they are not always the same.
FWIW.... I'm "adding" data elements from "checked" checkboxes here...
var AddOns = 0;
$( '.broadcast-channels').each(function(){
if ( $(this).prop("checked")) {
var thisAddOn = parseFloat($(this).data('channel'));
AddOns = AddOns + thisAddOn;
}
});