user avatar
user avatar
user avatar
VLAZ
  • Member for 7 years, 1 month
  • Last seen this week
Stats
6,904
reputation
1k
reached
7
answers
4
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
8
silver badges
10
bronze badges
18
Score
9
Posts
82
Posts %
9
Score
2
Posts
18
Posts %
4
Score
2
Posts
18
Posts %
4
Score
1
Posts
9
Posts %
4
Score
1
Posts
9
Posts %
3
Score
1
Posts
9
Posts %
Top posts
View all questions and answers