DEV Community

Discussion on: Technique Sliding Windows algorithms

pentacular profile image

if (!!pivotLeft) { ... }

Just wondering if there's a special reason you're using this construct.

It looks seems entirely equivalent to

if (pivotLeft) { ... }

to me, so I'm wondering if I've overlooked something.

difo23 profile image
Lizandro J. Ramírez

I don't have a special condition to use (!!) it is just custom, I like that the conditions in a certain way handle Boolean only, so when (!! Null) it allows me to be aware of its boolean value although it does not affect the final solution.