'What is this function declaration saying? [duplicate]

new to Javascript.

Was playing around with a controller for a calculator and came across this function definition. Its bizarre, and I'm hoping someone might be able to clarify this. Why is number repeated here?

function calculationCommission(monthlyRevenue: number): number {

//function does stuff

}


Solution 1:[1]

First number is type of argument of function that will receive and second one is type of function return. In this situation both are number

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sahand Zeynol