// Conditions:
// If s is null and n is null, then result should be null
// If s is null and n is 1, then result should be "1"
// If s is "2" and n is null, then result should be "2"
// If s is "2" and n is 1, then result should be "2"
const s: string | null = null;
const n: number | null = 1;
const result: string | null =
(s ?? (n != null) ? String(n) : null); // Looking for a more concise way to do this
console.log(result);
Any suggestions for simplifying/improving the logic of result
in Typescript?