Javascript Calculator is not passing test number 11

I don’t understand what is going wrong. My calculator block entering more than one dots(.) . My code is here (https://codepen.io/sayin47/pen/qBRrqyZ)`

Hi. Your confirmationDot function is only checking if the last item of the array is a dot(.) not if there is a dot(.) in any index of the array, that leaves it open to do something like 6.7.8. You will need the function to check the entire array and only allow one dot(.). Hope this helps.

Ok I will try to add a regex function to filter it

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.