question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] Strange piece of logic

See original GitHub issue

at lib/components/breadcrumb.vue found this piece of logic:


                  if (item.active !== true && item.active !== false) {
                         item.__active = item === last;
                     } else {
                         item.__active = item.active;
                     }

Can somebody explain me why to use such complex statement? item.active !== true && item.active !== false => true when item.active undefined or null? item.active !== true && item.active !== false => false when item.active is set ?

why dont just use item.active == null instead?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mosinvecommented, May 9, 2017

Hm, so its all about ESLint… and found another intersting resource https://jsperf.com/comparison-of-comparisons

1reaction
mosinvecommented, May 9, 2017

so what’s wrong with my example? )))))) Im not the guru of JS, so it will be good to know my mistakes

Read more comments on GitHub >

github_iconTop Results From Across the Web

What makes logic 'strange'? - Quora
There is no logic reason,no explanation,no alternative. They build ideas and beliefs up inside their head as to what they see or hear...
Read more >
Weekly Discussion: Logic and Thought : r/philosophy - Reddit
Just as a reminder, there's a schedule for upcoming weekly discussions here . Logic and Thought# In this post, I'm going to…
Read more >
8 Logical Fallacies That Mess Us All Up - Mark Manson
8 Logical Fallacies That Mess Us All Up · 1. Correlation Is Not Causation · 2. Slippery Slope Fallacy · 3. False Dichotomies...
Read more >
Strange comicvine logic - Gen. Discussion - GameSpot
A character might be able to lift and toss cars with ease and yet people will say he is weak and cannot punch...
Read more >
A Strange Bit Of Logic | Page 3 | Speak EV - Electric Car Forums
When I bought my EV, I was driving a 13 year old VW Golf that needed about $1500 worth of work to keep...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found