Reactjs – Type guarding on boolean value in TypeScript
I have a boolean variable (let's call it isX) and two functions (getA and getB) that return different types of array: const isX: boolean; (value unknown at compilation time) fn getA(): A[]; fn getB(): B[]; The function that is called…