I noticed something odd where when I define a method signature (i.e. foo(name: string): string) I can write code that compiles but will cause a runtime error, but if it's a function property (i.e. foo: (name: string) => string) it works as expected. Can someone explain why that is?
Specifically, for some reason when Foo implements IFoo it can use a different argument type when using a method signature. This leads to a runtime error, yet the type checker is fine.
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.