Can't understand this [Help]

ساخت وبلاگ
Bitwise Operators
JavaScript supports the following bitwise operators: Assume variable A holds 2 and variable B holds 3, then:

1-& (Bitwise AND)

It performs a Boolean AND operation on each bit of its integer arguments. Ex:(A & B) is 2.

2-

| (BitWise OR) It performs a Boolean OR operation on each bit of its integer arguments. Ex: (A | B) is 3.

3-
^ (Bitwise XOR) It performs a Boolean exclusive OR operation on each bit of its integer arguments. Exclusive OR means that either operand one is true or operand two is true, but not both. Ex: (A ^ B) is 1.
4-
~ (Bitwise Not) It is a unary operator and operates by reversing all the bits in the operand.

My question is why in the first case 1- why the bolded (A & B) is 2???? thats my question if Var a = 2 and var b = 3 why it choose variable a not be and result finally : (A & B) is 2 ??? similarly question for all cases 2- | (BitWise OR) and 3- ^(BitWise XOR)

explain please this is the only problem i face in my javascript book
CodingForums...
ما را در سایت CodingForums دنبال می کنید

برچسب : نویسنده : codingforums بازدید : 150 تاريخ : چهارشنبه 28 تير 1396 ساعت: 12:53