user avatar
user avatar
user avatar
VLAZ
  • Member for 7 years, 1 month
  • Last seen this week
Stats
893
reputation
7k
reached
7
answers
3
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

2
gold badges
10
silver badges
20
bronze badges
13
Score
3
Posts
30
Posts %
11
Score
2
Posts
20
Posts %
8
Score
2
Posts
20
Posts %
8
Score
1
Posts
10
Posts %
7
Score
5
Posts
50
Posts %
7
Score
3
Posts
30
Posts %