Continuing the discussion from Discouraged about how my code looks :
const getI = r => +!r?.employee?.foo
! is the logical NOT operator, so it will take whatever
r?.employee?.foo returns and convert that value to its opposing boolean value (i.e if
r?.employee?.foo returned a falsy value then
! will convert it to
true and vice versa).
+ operator will then forcibly convert that boolean value into a number (either