To be, or not to be, that is the question
Translating it into code, we get
theQuestion = 2b || !2b
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
Member for 6 years, 3 months
29 profile views
Last seen Jul 20 at 13:39
- Stack Overflow 19.7k 19.7k 88 gold badges3636 silver badges5656 bronze badges
- Worldbuilding 6.6k 6.6k 22 gold badges1818 silver badges4747 bronze badges
- Meta Stack Exchange 2.4k 2.4k 11 gold badge88 silver badges2323 bronze badges
- Science Fiction & Fantasy 879 879 22 gold badges99 silver badges1919 bronze badges
- Software Engineering 779 779 11 gold badge77 silver badges99 bronze badges
- View network profile
Top network posts
- 72 Is it good practice to echo PHP code into inline JS?
- 71 Why would people bury their dead in tombs when they might become zombies?
- 53 Where could a vampire get blood without harming people?
- 51 What would cause a culture to keep a distinct weapon for centuries?
- 46 Backwards the migration close reason text is
- 41 Origin of genies (from lamps) having a three wish limit?
- View more network posts →