TypeScript · Junior · Question 74 of 75

What type does a function parameter with a default value get?

function paginate(page = 1) { /* ... */ }

Explanation

Callers may omit the argument or pass undefined; inside the function page is always a number.

Further reading

Problem with a question

TypeScript · Junior · question 74

Test yourself

Take the TypeScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz