Open oliverjam opened 4 years ago
If you're going to use a complex-ish expression multiple times it's a good idea to give it a descriptive name.
https://github.com/mhtien/js-calculator/blob/d220d0209c55d1f10150d0f5dc68ab42bffe1d78/script.js#L218-L235
operatorsArray[i] isn't too hard to parse, but you could save yourself some typing/reading later on with const operator = operatorsArray[i] at the top.
operatorsArray[i]
const operator = operatorsArray[i]
Thanks again for the tips! It does read a lot clearer now :+1:
View changes here
If you're going to use a complex-ish expression multiple times it's a good idea to give it a descriptive name.
https://github.com/mhtien/js-calculator/blob/d220d0209c55d1f10150d0f5dc68ab42bffe1d78/script.js#L218-L235
operatorsArray[i]
isn't too hard to parse, but you could save yourself some typing/reading later on withconst operator = operatorsArray[i]
at the top.