This is very well explained. You can also call this the double NOT operator if you'd like.
While Boolean(someValue) the same things as !!someValue, using the double not operator is shorter to write and a tiny bit faster. The speed increase is nothing meaningful, but interesting nonetheless.
Benchmark I ran in case you want to see for yourself:
This is very well explained. You can also call this the double NOT operator if you'd like.
While
Boolean(someValue)
the same things as!!someValue
, using the double not operator is shorter to write and a tiny bit faster. The speed increase is nothing meaningful, but interesting nonetheless.Benchmark I ran in case you want to see for yourself:
This is interesting. Never thought about
Boolean()
. Thank you.