VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 4 years, 1 month
  • Last seen more than a week ago
Stats
457
reputation
599
reached
0
answers
7
questions
Loading…
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
3
silver badges
10
bronze badges
0
Score
7
Posts
100
Posts %
0
Score
4
Posts
57
Posts %
0
Score
2
Posts
29
Posts %
0
Score
1
Posts
14
Posts %
0
Score
1
Posts
14
Posts %
0
Score
1
Posts
14
Posts %