Skip to content
RED SAG Skills
hard20 pts · first answer countsjavascripttypescriptfunctions

Method versus property function types

With strictFunctionTypes on, Animal is a supertype of Dog. Which assignment is allowed even though it is unsafe?

interface A { handle(x: Animal): void }      // method syntax
interface B { handle: (x: Animal) => void }  // property syntax
const dogFn = (d: Dog) => {}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions