This is the code.
function inspect(item: { label: string } | {}) {
if (item.label) { //error
console.log("inspect jingo");
}
}
The error I receive says The property "label" does not exist in the type "{} | {label: string;}".The property "label" does not exist in the type "{}".
I'm a typescript beginner. How can I declare that item accepts either an empty object or {label: string}.