You are here: irt.org | FAQ | JavaScript | Number | Q1287 [ previous next ]
Use the logical &:
<script language="JavaScript"><!-- var Num = 99; var result = (99 & 0xAA); document.write(result); //--></script>
If however you want to create a binary mask using 0's and 1's then use:
<script language="JavaScript"><!-- var Num = 99; var result = (99 & parseInt('10101010', 2)); document.write(result); //--></script>