I've recently started using double exclamation points !!
before an object to make sure that it's not null and that it's not undefined and not an empty string, to make sure that I encompass all the different ways that a variable can be empty.
Is this necessary? It's hard to read, for instance:
if(!!name)
vs if(name)
Any opinions on this? I want my code to be safe and not get into conditions where a null pointer exception and other things can occur, but I also want my code to be readable.