I'm using .filter to filter my query data to find the rows with rental_duration equal to 6, using .map to only grab the length column from those rows, then summing the length column using .reduce
What if the value i was trying to sum up was placed as a string instead of a number. Where in the formula would be the best place to convert to number?
You should be able to use the parseint(string) function to surround obj in the reduce function, or you could tack on another .map function after the first .map function to do something like .map(str => parseInt(str))
Since our JS is getting a little long, you might also find some benefit in creating a JS transformer and just writing this logic out there (in more than just one line ) and referencing {{your_transformer.value}} in your component value field.