Asserts wether an object has a property and narrows down the signature
const fruit: Fruit = { color: 'yellow' }if (hasProperty(fruit, 'color')) { console.log(fruit.color)}
Generated using TypeDoc
Asserts wether an object has a property and narrows down the signature
Example