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

Stats

671
reputation
2k
reached
0
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

1
gold badge
5
silver badges
13
bronze badges
0
Score
15
Posts
100
Posts %
0
Score
5
Posts
33
Posts %
0
Score
3
Posts
20
Posts %
0
Score
2
Posts
13
Posts %
0
Score
2
Posts
13
Posts %
0
Score
2
Posts
13
Posts %

Top posts

View all questions and answers