What is !! in JavaScript ? where & how we can use it ? Let's discuss some feature of !! "Double Shots or Double Exclamation" in JavaScript. So where it can be helpful, let's say we have some production grade application where we have some code that g...

Markdown supported · ⌘↵ to post
Hi Akshay,
I use this a lot during coding. This is the best way to check null or undefined I guess.
George Jempty (Dexygen)
Software, Powerful and Simple
I used to use
!!foobarBut now use
Boolean(foobar); // function, NOT object preceded by newAs it expresses the intent more clearly.