user avatar
user avatar
user avatar
VLAZ
  • Member for 4 years
  • Last seen this week
Stats
4,532
reputation
30k
reached
12
answers
15
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
13
silver badges
30
bronze badges
158
Score
9
Posts
33
Posts %
73
Score
4
Posts
15
Posts %
60
Score
3
Posts
11
Posts %
18
Score
2
Posts
7
Posts %
16
Score
2
Posts
7
Posts %
8
Score
5
Posts
19
Posts %
Top posts
View all questions and answers