Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6254543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:11:50+00:00 2026-05-24T14:11:50+00:00

I was playing the Javascript game with somebody and we were having fun making

  • 0

I was playing the Javascript game with somebody and we were having fun making ridiculous and absurd expressions to make our inputs get a particular output.

This little charming one

!a!=!!b^!!-!a||!+!a|!c

always seemed to return 1. I tried to reason it out, but I gave up after losing track of all the !s.

Are there any values for a, b, and c which do not return 1? If not, why does it always return 1?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:11:50+00:00Added an answer on May 24, 2026 at 2:11 pm

    Short answer, yes. a = false, b = false, c = true is a counter-example because your equation is identical to (!!a || !!b || !c).

    Long answer:

    !a!=!!b^!!-!a||!+!a|!c
    

    is

    (((!a) != (!!b)) ^ (!!(-!a))) || ((!+!a)|!c)
    

    which reduces to

    ((Boolean(a) == Boolean(b)) ^ (!a)) || (Boolean(a) | !c)
    

    so all of a, b and c are only dealt with as truthy/falsey values and the result must be a 1 or 0 since | and ^ both coerce booleans to numbers.

    So obviously (from inspection of the right of the ||) if either a is truthy or c is falsey, you get 1.

    If a is falsey and c is truthy, you have two possibilities,

    1. b is truthy in which case the ^ clause is 1 so the right of the || is never reached.
    2. b is falsey, in which case the ^ clause is 0 so the right of the || dominates to produce 0.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so I'm making an html5 canvas/javascript game. I'm playing around with the idea
I'm playing with facebook's javascript sdk and can't get the user email address to
I'm having a weird problem with some JavaScript/DOM code I've been playing with. I'm
I've been playing around with prototypal inheritance after reading http://javascript.crockford.com/prototypal.html and having a bit
Been playing with the thought of javascript game. Especially RTS types... the question is
I was playing with JavaScript class inheritance (I am using node.js). I get undefined
I have been playing with javascript arrays and I have run into, what I
So I'm playing around with JavaScript and came across what I think to be
So, I am learning Javascript while playing white Google Calendar APIs and I just
I'm diving into javascript and one of the concepts I'm playing with is XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.