Given the scenario presented
interface fooInterface {
bar: any;
}
function(value: fooInterface | string) {
value.bar
}
An issue arises with the message: Property 'bar' does not exist on type '(fooInterface | string)'
I seem to be making a mistake. Essentially, what I aim to convey is that the 'value' can be either an object adhering to fooInterface or a string.
What approach should I take to achieve this?
Your assistance is appreciated