Skip to main content
VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 5 years, 11 months
  • Last seen this week
Stats
11,678
reputation
182k
reached
57
answers
30
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

3
gold badges
29
silver badges
70
bronze badges
698
Score
45
Posts
52
Posts %
360
Score
20
Posts
23
Posts %
266
Score
15
Posts
17
Posts %
237
Score
16
Posts
18
Posts %
46
Score
7
Posts
8
Posts %
32
Score
13
Posts
15
Posts %
Top posts
View all questions and answers