Another solution is to use the toFixed() method to round the result to the desired number of decimal places. For example, if the desired result is 2 decimal places, you can use the following code:
const data = datatable.reduce((acc, bill) => bill + acc);return data.toFixed(2);
This will round the result to 2 decimal places and return a string, which can then be converted to a number if needed.
Overall, the best solution will depend on the specific requirements of the application and the nature of the data being processed.