Checking out the TypeScript documentation available at: https://www.typescriptlang.org/docs/handbook/functions.html, we come across the concept of "Function Types." An example code snippet illustrating this is:
let myAdd: (x: number, y: number) => number =
function(x: number, y: number): number { return x+y; };
In contrast, a "non-typed" function would look like this:
let myAdd = function(x: number, y: number): number { return x+y; };
The additional syntax in the first example might seem peculiar. Why is there an arrow-function syntax for specifying the return type? And why are there two parameter specifications?