Suppose we define a function using explicit typing, such as
var func : (arg1: string, arg2: number) => boolean;
as you can see, we should use '=>' here, but we cannot use this bold arrow in our function declaration.
func = function name(arg1: string, arg2: number) : boolean {return true;}
But in a lambda function, for example, we use '=>' this bold arrow, why?
var lambdaFunc = (arg1: string, arg2: number) => true;
and in functional typed interfaces, why we use this, for example, we use a colon :.
interface SearchFunc { (source: string, subString: string): boolean; }
What is this confusion?
source share