I am checking for null
like this:
let's say c
is null.
if (a == null || b == null || c == null || d == null) { //short cirtcuit on the first null value (c)
let grabNullKey = a == null || b == null || c == null || d == null;
// I want this to grab the variable that is null, instead this logs `true`
console.log(grabNullKey)
I want to log the variable name (c
) to the user, is there a shorthand to output the variable name instead of doing 4 if statements?