Skip to main content
VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 5 years, 7 months
  • Last seen more than a month ago
About

To be, or not to be, that is the question

Translating it into code, we get

theQuestion = 2b || !2b

This returns true for any value of 2b, making the evaluation redundant. We can optimise it by removing the expression and substituting with the result.

theQuestion = true

Badges
1
gold badge
1
silver badge
1
bronze badge
Posts

This user hasn’t posted yet.