Skip to main content
VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 9 years, 1 month
  • Last seen this week
Stats
7,886
reputation
173k
reached
78
answers
1
question
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
25
silver badges
57
bronze badges
257
Score
26
Posts
33
Posts %
221
Score
8
Posts
10
Posts %
100
Score
11
Posts
14
Posts %
95
Score
5
Posts
6
Posts %
91
Score
6
Posts
8
Posts %
84
Score
8
Posts
10
Posts %
Top posts
View all questions and answers