TypeScript function type syntax explanation

Viewed 1706

I'm reading the TypeScript Handbook and in the Functions section under the Function Types heading there is this example (which I understand):

let myAdd = function(x: number, y: number): number { return x+y; };

This is followed by

let’s write the full type of the function out by looking at the each piece of the function type.

and this syntax:

let myAdd: (x: number, y: number) => number =
    function(x: number, y: number): number { return x+y; };

Could someone break this down and explain it as I have never seen this before and can't find an explanation in the handbook?

2 Answers
Related