Possible Duplicate:
Where would I use a bitwise operator in JavaScript?
In c/c++
bitwise operations are faster than normal(arithmetic) operations(significant atleast in low performance processors). Does the same apply in js
? I don't think as the reason its faster in c is bitwise operations are hardwired and usually are completed in 1 processor cycle. But js
runs within browser which doesn't have any such hardware(registers I mean) access. I am not sure (around 70% sure :) ). What are typical(or some smarter) uses of bitwise operators (especially in js
but I would like to know others too). Please correct me if I am wrong anywhere.