Skip to main content
VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 7 years, 4 months
  • Last seen this week

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
51
silver badges
125
bronze badges
1,503
Score
97
Posts
54
Posts %
557
Score
36
Posts
20
Posts %
547
Score
39
Posts
22
Posts %
499
Score
34
Posts
19
Posts %
269
Score
15
Posts
8
Posts %
124
Score
28
Posts
16
Posts %

Top posts

View all questions and answers