I tried a few examples in the typescript reference. More specifically, I came across function types.
interface SearchFunc {
(source: string, subString: string): boolean;
}
interface SearchFunc {
(source: string, subString: string): boolean;
}
var mySearch: SearchFunc;
mySearch = function(subString: string) {
var result = 1;
if (result == -1) {
return false;
}
else {
return true;
}
}
I wonder why the above does not show me any errors. mySearchclearly does not match the signature declared in the interface.
source
share