interface DescribableFunction {
description: string;
(f: number,s:number): number;
};
function doSomething(fn: DescribableFunction) {
console.log( " returned " + fn(3,4));
}
//here,"const" is right,"let" will be error
const p:DescribableFunction=(first:number,second:number)=>first+second;
p.description="hello";
doSomething(p);
if DescribableFunction has no "description" field,const or let will be ok I test it at https://www.typescriptlang.org/play