In the below function, I have assigned a default value to the second parameter of that function that will be used if no value has been assigned as the second parameter of that function.
function add(a: number, b: number=2) : number { return a+b }
First let us run the above function with all values as follows:-
console.log(add(1,2)) /* 3 */
Next let us leave out the second parameter as follows:-
console.log(add(3))
With the absence of the second parameter, you will then get the below answer:-
5
If you do not supply any value for the second parameter of the above function then the initial default value will be used instead which will lead to 3 + 2 = 5!