user avatar
user avatar
user avatar
VLAZ
  • Member for 7 years, 1 month
  • Last seen this week
Stats
6,904
reputation
148k
reached
69
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
21
silver badges
51
bronze badges
249
Score
25
Posts
36
Posts %
224
Score
8
Posts
11
Posts %
96
Score
5
Posts
7
Posts %
95
Score
9
Posts
13
Posts %
86
Score
5
Posts
7
Posts %
84
Score
8
Posts
11
Posts %
Top posts
View all questions and answers