I don’t know what this is called, so I’ll try to give a pretty clear example…
Say we have 3 lists; a, b, & c
We assign each of these lists a binary value. a = 1, b = 10, c = 100 (d would be 1000, etc)
We have 2 objects; y & z
To tell which objects relate to which lists, we give it a binary value also. Say object y is 101. Since the first and third values are 1’s, we know it’s related to list a and list c. If object z is 11, we know it’s related to lists a and b.
Someone showed me how to do this programmatically some time ago, but I can’t recall. I’d like to do this sort of mapping in javascript. Anybody know how this is done?
You can do it by using the binary operator
&. This is how you do it: