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

1
gold badge
12
silver badges
14
bronze badges
69
Score
18
Posts
72
Posts %
27
Score
2
Posts
8
Posts %
27
Score
2
Posts
8
Posts %
23
Score
2
Posts
8
Posts %
17
Score
5
Posts
20
Posts %
13
Score
4
Posts
16
Posts %