Skip to main content
VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 10 years, 1 month
  • 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

2
gold badges
26
silver badges
58
bronze badges
263
Score
27
Posts
33
Posts %
222
Score
8
Posts
10
Posts %
106
Score
12
Posts
15
Posts %
96
Score
5
Posts
6
Posts %
95
Score
7
Posts
9
Posts %
84
Score
8
Posts
10
Posts %