r/badcode • • Sep 28 '21

typescript Now that’s how you toggle

Post image
8 Upvotes

20 comments sorted by

View all comments

Show parent comment

2

u/MidiOwl Sep 29 '21

You have not named a good reason. Tbh it is quite obvious that you are just arguing for the sake of arguing and I’m not really interested. Have a good day

0

u/a_soupling Sep 29 '21 edited Sep 29 '21

If you made obj,refr_unit a Boolean you’d have to tie the condition every time you want to manipulate its numeric value and repeat the number, not the variable, multiple times. It’s not clear that it’s purpose is to serve as a condition, but a clean and editable (e.g adding) number.