Sukhrobjon / TipCalculatorWeb

FEW-1.1 Class challenge
0 stars 0 forks source link

Whoa! #4

Open soggybag opened 6 years ago

soggybag commented 6 years ago

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.