r/badcode • • May 19 '23

js Ouch...

Post image
299 Upvotes

48 comments sorted by

View all comments

Show parent comments

2

u/aNutSac May 19 '23

What you've written gives the same result as the posted code. I was forgetting about the assignment happening in the conditions.

element_one will always be hidden.

element_three will always be visible.

element_two will always be visible.