Casting Spells with 1s and 0s

Test your JavaScript programming skills by solving the given puzzle about the workings of the tilde operator.

Puzzle code

Carefully read the code given below:

Get hands-on with 1200+ tech skills courses.