TypeScript | TypeScript Functions | Question 1

Last Updated :
Discuss
Comments

Which of the following is the correct way to declare a function type in TypeScript?

function sum(x: number, y: number): number;

let sum: (x: number, y: number) => number;

let sum: (x: number, y: number) -> number;

function sum(x: number, y: number) -> number;

Share your thoughts in the comments