I'm working to maintain the D&D_OED sheet which was mostly set up by another person. The worker script includes a piece to sum up a series of encumbrance-value fields ( attr_enc_1 and so forth), that looks like this: // Gather encumbrance fields const items = []; for ( i = 1; i <= 40; i++ ) { items.push( 'enc_' + i ); } items.reverse(); // Compute total encumbrance var total = 0; items.forEach( item => { on( `change:${item} sheet:opened`, () => { getAttrs( items, values => { items.forEach( enc => { total = total + parseFloat( values[enc] )||0; }); setAttrs({total_enc: total}); }); }); }); Note that inside the forEach() loop there's the code parseFloat( values[enc] )||0 , which is meant to give a default value of zero if the field is blank or a non-number (per <a href="https://wiki.roll20.net/Sheetworker_examples_for_Non-programmers#Get_Attributes" rel="nofollow">https://wiki.roll20.net/Sheetworker_examples_for_Non-programmers#Get_Attributes</a>), and does so in other instances on this sheet. However, this default seems to be failing in the context of the forEach() loop. If any such field is blank or a non-number (e.g., "-" or "x", which might be used to indicate a null value), then the loop seems to stop processing and fails to add up any later values. Some examples: {1, 2, 3, 4, 5} -> Total is 15 (correct) {1, 2, 3, 4, -} -> Total is 10 (okay) {-, 2, 3, 4, 5} -> Total is 0 (incorrect) {1, 2, -, 4, 5} -> Total is 3 (incorrect) Note that blank or non-number fields later on don't cause a problem (e.g., most of the fields from some point are always blank). I assume that's why the original author was careful to include the items.reverse() function. But I'd prefer that blank or non-number fields near the start of the sequence not break the summing process. How can I fix this so the parseFloat default works inside the forEach() loop?