I have a function that returns an object of type Bar
like this
myFunc() {
return <Bar>asyncGet(); / fetches the info and casts the server response to Bar
}
than in some controller, if I do
let bar = myFunc();
// bar instanceof Bar doesn't return true...
instanceof
is not working as expected since I didn't instanciate bar via Bar
constructor.
How can I check that the object returned by myFunc
is of type Bar
?