Skip to main content
VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 6 years, 6 months
  • Last seen this week
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

3
gold badges
38
silver badges
91
bronze badges
908
Score
55
Posts
46
Posts %
412
Score
22
Posts
18
Posts %
270
Score
15
Posts
13
Posts %
241
Score
16
Posts
13
Posts %
94
Score
22
Posts
18
Posts %
84
Score
38
Posts
32
Posts %