5 ms·
I use them when doing an assignment and equality check in the same if statement. I find that putting the equality check first helps readability and makes the in
by dhotson 15y ago
I use them when doing an assignment and equality check in the same if statement. I find that putting the equality check first helps readability and makes the intent clearer.
eg.
if (null == (data = cache.get('blah')))
// cache miss
else
// cache hit