?? operator will coerce undefined and null values to false and other values to true. let propertyCheck = person.age ?? 0; let objectAndPropertyCheck = (person ?? {}).age ?? 0; // or let objectAndPropertyCheck2 = person?.age ?? 0; // the ? character ...