This question is likely to be closed as too broad, and this answer may collect its fair share of downvotes for not responding directly, but here it goes.
Please, please , be extremely careful in using shortcuts in a programming language, because ... really ... who do they help?
Most of these shortcuts sacrifice clarity and evidence of keystrokes. You will not find a single competent professional coder who agrees that this is a reasonable compromise.
Consider
if("foobar".indexOf("foo") > -1)
to
if(~"foobar".indexOf("foo"))
You have saved 4 characters ... whoopie! However, you also guaranteed that anyone who does not know this shortcut has a very subtle chance to find out what is happening here ... and, of course, not with ease.
Reading the definition of indexOf enough to understand the explicit version. For the second, you need to understand what ~ means (which is a rather unusual statement in JS). Then you need to know what a bitwise complement of -1 is. Then you need to understand that this is true.
This is a stupid compromise, and it is a sign of many of these idioms.
Please do not do this. This is not the 80s.
Dancrumb
source share