What is the difference between if(!!condition) and if(condition)

Technically nothing. The double bang !! type converts value to a boolean – something the if statement does when it evaluates value anyway.

In the code you have posted, the !! is useless and serves no purpose.

Leave a Comment