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
38
bronze badges
146
Score
8
Posts
33
Posts %
111
Score
4
Posts
17
Posts %
55
Score
3
Posts
12
Posts %
49
Score
11
Posts
46
Posts %
38
Score
2
Posts
8
Posts %
32
Score
5
Posts
21
Posts %