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

2
gold badges
21
silver badges
35
bronze badges
49
Score
11
Posts
55
Posts %
42
Score
5
Posts
25
Posts %
32
Score
4
Posts
20
Posts %
26
Score
2
Posts
10
Posts %
22
Score
4
Posts
20
Posts %
18
Score
3
Posts
15
Posts %