Can typescript infer from ternary operator?

Const example = test === true ? {count: 5} : {string: "string"} Is that possible to somehow get this working.
1 Reply
Benjamin
Benjamin2y ago
What do you mean? If your function returns a ternary operator, its return type will be infered properly
Want results from more Discord servers?
Add your server