score = (x) -> if x == "Yes" 10 else 0 weights = [0.25, 0.25, 0.25, 0.25] scope_1_n_2_ghg_emissions = [reductions, targets, targets_reporting, alignment] weights.reduce((weighted_sum, weight, index) -> weighted_sum + weight*score(scope_1_n_2_ghg_emissions[index]) , 0)