Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

314
Views
Comparing masks with binary & and have the number of differences in JS
export enum VALUES {
  VALUE1 = 0x0001,
  VALUE2 = 0x0002,
  VALUE3 = 0x0004,
  VALUE4 = 0x0008,
  VALUE5 = 0x0010,
  VALUE6 = 0x0020,
  VALUE7 = 0x0040,
  VALUE8 = 0x0080,
  VALUE9 = 0x0100
}

In JS it's easy to know if a mask contains a value with the & operator:

(mask & VALUES.VALUE1) === VALUES.VALUE1

But how can i compare two masks and know which are the differences or how many differences there is ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!