Web Tool Bag  
Home · Articles · Downloads · Discussion Forum · Web Links · News CategoriesJuly 31 2010 10:19:42
Navigation
Home
Articles
Downloads
Discussion Forum
Web Links
News Categories
Search
Users Online
Guests Online: 5
No Members Online

Registered Members: 207
Unactivated Members: 0
Newest Member: Emily Benjamin
Bitwise Javascript Operators

There are 7 bitwise operators, &, |, ^, ~, >>, <<, and >>>.

These operators convert their operands to integers (truncating any floating point towards 0), and perform the specified bitwise operation on them. The logical bitwise operators, &, |, and ^, perform the and, or, and xor on each individual bit and provides the return value. The ~ inverts all bits within an integer, and usually appears in combination with the logical bitwise operators.

Two bit shift operators, >>, <<, move the bits in one direction which has a similar effect to multiplying or dividing by a power of two. The final bit-shift operator, >>>, operates the same way, but does not preserve the sign bit when shifting.

These operators are kept for parity with the related programming languages but are unlikely to be used in most JavaScript programs.


Posted by zdravko on December 28 2009 14:12:15 401 Reads · Print
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

No messages have been posted.
manual submit
Copyright © 2010 - www.webtoolbag.com