Click here to Skip to main content
15,891,937 members
Articles / Programming Languages / Javascript

Using bitwise operations to filter results based on user selected filters in javascript

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
12 Aug 2011CPOL3 min read 32.1K   2  
How to use javascript bitwise operations to filter out search results based on user selected filters in checkboxes

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
26 Jul 2011George Tryfonas
Not sure I got it correctly... But if I did, here's a simpler solution which doesn't rely on implication. Bitfields are ubiquitous in C programming, they are used to specify flags. If, for instance, your hotel requirements amount to bitfield 01101010 then you can simply AND the bitfield with...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Greece Greece
I am a web developer for a software house in Athens, Greece. I currently work almost exclusively with the Microsoft stack of languages, and most prominently with C#. However, I have worked extensively with PHP in the past, dabbled in C and C++ while doing my MSc, and for my pet projects I usually resort to Python, if a GUI is not necessary. That said, I'm also usually the guy that oversees/designs the database schema for each new project at work.

When not in front of the computer, I enjoy watching and helping my two young daughters grow up. Sometimes I do that while in front of the computer too.

Comments and Discussions