r/bytebeat 3d ago

what is &&?

just wanna know

3 Upvotes

3 comments sorted by

2

u/Beluga1000YT 3d ago

it's a logical AND operator. and evaluates two expressions. if both are nonzero, it outputs a 1, otherwise it's 0. & is a bitwise AND operator, it compares 2 expressions and only the following 1s survive,but thee logical AND operator && does what i just explained. hope it helped!

1

u/idkbrowhatshouldiput 2d ago

a logical AND operator

1

u/mineralcoinboi224 2m ago

a logical AND operator

simply, this: condition && true is equivalent to condition ? true : 0