When does "true" equal "false" in JavaScript?

Published: 27 July 2021
on channel: Andrew Hoffman
1,117
4

👍👍👍 and subscribe for more:    / @and1hof  
Check out my best selling AppSec book: https://amzn.to/3pGO4Vz
Check out my behind-the-scenes newsletter: https://www.andrewhoffman.me/newsletter/

The ! operator in JavaScript converts an object to a boolean and than flips it from true to false or from false to true. Operations involving this operator can get confusing, in this case the strings equate because they are comparing length rather than value after being coerced into booleans and flipped.


On this page of the site you can watch the video online When does "true" equal "false" in JavaScript? with a duration of online in good quality, which was uploaded by the user Andrew Hoffman 27 July 2021, share the link with friends and acquaintances, this video has already been watched 1,117 times on youtube and it was liked by 4 viewers. Enjoy your viewing!