functiontwoParams(a:number,b:number) {return a + b;}let curryOne =twoParams.bind(null,123);curryOne(456); // Okay but is not type checked!curryOne('456'); // Allowed because it wasn't type checked!
functiontwoParams(a:number,b:number) {return a + b;}letcurryOne= (x:number)=>twoParams(123,x);curryOne(456); // Okay and type checked!curryOne('456'); // Error!
classAdder {constructor(public a:string) { }add(b:string):string {returnthis.a + b; }}functionuseAdd(add: (x:number) =>number) {returnadd(456);}let adder =newAdder('mary had a little 🐑');useAdd(adder.add.bind(adder)); // No compile error!useAdd((x) =>adder.add(x)); // Error: number is not assignable to string