This variable hasn't been declared with const, let, or var. This means the variable is declared as a global! This is bad practice, and not your intent!
You should declare this with const inside the function:
const calculateTotalForEach = ...
The other variables should be declared inside the function the same way.
https://github.com/Sukhrobjon/TipCalculatorWeb/blob/7716a5d3581babe69863a8479fa79d80aa145d1b/main.js#L25
This variable hasn't been declared with const, let, or var. This means the variable is declared as a global! This is bad practice, and not your intent!
You should declare this with const inside the function:
const calculateTotalForEach = ...
The other variables should be declared inside the function the same way.