Actually, there appears to now be a simple way. The following code works in TypeScript 1.5:

function sayName({ first, last = 'Smith' }: {first: string; last?: string }): void {
  const name = first + ' ' + last;
  console.log(name);
}

sayName({ first: 'Bob' });

The trick is to first put in brackets what keys you want to pick from the argument object, with key=value for any defaults. Follow that with the : and a type declaration.

This is a little different than what you were trying to do, because instead of having an intact params object, you have instead have dereferenced variables.

If you want to make it optional to pass anything to the function, add a ? for all keys in the type, and add a default of ={} after the type declaration:

function sayName({first='Bob',last='Smith'}: {first?: string; last?: string}={}){
    var name = first + " " + last;
    alert(name);
}

sayName();
Answer from jpadvo on Stack Overflow
🌐
TypeScript Tutorial
typescripttutorial.net › home › typescript tutorial › typescript default parameters
TypeScript Default Parameters
June 2, 2020 - Use default parameter syntax parameter:=defaultValue if you want to set the default initialized value for the parameter. Default parameters are optional.
Discussions

Is there a way to have a default value for an object argument passed to a function?
Destructuring with default value is more readable in most cases. If you don’t want to destructure everything you can do: function order(orderInfo: OrderInfo) { const {onSale = true} = orderInfo; } Then you don’t lose the original object More on reddit.com
🌐 r/typescript
26
6
January 7, 2026
Conditional parameter with default values
Why not just do an instanceof check on the animal? if(animal instanceof Dog){ return animal.bark() } then you can remove the boolean parameter entirely. More on reddit.com
🌐 r/typescript
13
2
June 29, 2022
Tricky question involving optional generic function parameter
I was trying to do something similar recently, where I wanted to enforce a certain object shape / interface as a default, then if i pass in a custom interface it takes it instead. I couldn't make it work either, so had to do T extends Record and ended up not properly typing it. Following this post to see what's the recommended practices if any More on reddit.com
🌐 r/typescript
17
6
June 5, 2024
How would I pass the default parameter values for generic types of extended interface
Is this what you're looking for? interface CustomRequest extends Request { user: User } const stringRequest: CustomRequest = … const numberRequest: CustomRequest = … More on reddit.com
🌐 r/typescript
4
13
June 16, 2022
🌐
Mimo
mimo.org › glossary › typescript › default-parameter
TypeScript Default Parameter: Syntax, Usage, and Examples
Define a default parameter by assigning a value directly in the function definition. When an argument is missing, TypeScript automatically assigns the default value.
🌐
Medium
medium.com › @kidaneberihuntse › simplifying-typescript-functions-with-default-parameter-values-d07bc6c54fa3
Simplifying TypeScript Functions with Default Parameter Values | by Kidu BT | Medium
March 29, 2024 - Let’s dive into how these features work together to streamline function declarations. To set a default value for a function parameter in TypeScript, you simply assign the default value directly in the parameter declaration.
🌐
TutorialsPoint
tutorialspoint.com › typescript › typescript_default_parameters.htm
TypeScript - Default Parameters
In TypeScript, we can assign the function parameters some values by default. Such parameters can be explicitly passed values. These parameters are known as default parameters. When a function is called with missing arguments, or argument with
🌐
Skypoint
skypoint.ai › home › typescript default parameters and destructuring as a substitute for named parameters
TypeScript Default Parameters and Destructuring As a Substitute for Named Parameters - Skypoint
September 23, 2022 - JavaScript, as well as TypeScript, doesn’t support this kind of assignment in a function call. Instead I’ll need to provide a value for all the parameters preceding currency. ... When I pass a parameter an undefined value JavaScript will use the default value for that parameter.
🌐
typescriptlang.org
typescriptlang.org › docs › handbook › 2 › functions.html
TypeScript: Documentation - More on Functions
They’re also values, and just like other values, TypeScript has many ways to describe how functions can be called. Let’s learn about how to write types that describe functions. The simplest way to describe a function is with a function type expression. These types are syntactically similar to arrow functions: ... The syntax (a: string) => void means “a function with one parameter...
Find elsewhere
🌐
Tim Mousk
timmousk.com › blog › typescript-default-parameter
How To Set A Default Parameter In TypeScript? – Tim Mouskhelichvili
March 6, 2023 - In this example, the year parameter is an optional parameter that fallbacks to the current year if it has no value. TypeScript also supports default values when destructuring an object inside a function definition.
🌐
HowToDoInJava
howtodoinjava.com › home › typescript › typescript optional and default parameters
TypeScript Optional and Default Parameters (with Examples)
June 23, 2023 - Default parameters help by providing ... default values when necessary. TypeScript allows assigning a default value to a parameter if no value or undefined is provided when invoking the function....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Functions › Default_parameters
Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › typescript tutorial › typescript default parameter
TypeScript default parameter | Learn How does default parameter work?
April 6, 2023 - The default parameter in TypeScript is used to assign some default value to the variable. In JavaScript, we have this provision not to pass the required argument to the called function because it internally manages, But in TypeScript, we cannot ...
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Codefinity
codefinity.com › courses › v2 › a5c23211-8dc2-4c4a-9a83-07a51e843ab6 › 22ee44ac-3952-4715-93f5-a0e487b41d5a › 2514af82-5f65-42e6-9010-4fcdb9dc7dab
Learn Default Values | Functions
Default values are often used alongside or in place of optional parameters. You can set a default value for a parameter, and if you don't specify a value for that parameter when calling the function, it will be initialized with the default value.
🌐
Convex
convex.dev › core concepts › functions & methods › optional parameters
Optional Parameters | TypeScript Guide by Convex
Parameters with default values are already optional, so the ? is redundant and not allowed. TypeScript requires all optional parameters to come last.
🌐
Nicolas Charpentier
charpeni.com › blog › be-careful-with-javascript-default-parameters
Be Careful With JavaScript Default Parameters! | Nicolas Charpentier
November 3, 2022 - By using the default parameter to true on showHeader, we're saying that we're expecting a boolean, but if no value is passed, we want to set showHeader to true by default. We're also using strict checks to make sure we're not getting any unexpected values as TypeScript tells us we can only get a boolean out of showHeader.
🌐
Scaler
scaler.com › home › topics › typescript › default and initialized parameters
Default and Initialized Parameters - Scaler Topics
May 4, 2023 - The default parameters are used to assign some default value to a variable. In JavaScript, we are not required to pass the required argument to the called function because it internally manages the passing and declaration of default values.
🌐
Tektutorialshub
tektutorialshub.com › home › typescript › default parameters in typescript
Default Parameters in TypeScript - Tektutorialshub
March 15, 2023 - The default parameters in TypeScript allow us to initialize parameters with default values if no value or undefined is passed as argument.
🌐
Execute Program
executeprogram.com › courses › advanced-typescript › lessons › default-type-parameters
Advanced TypeScript: Default Type Parameters
Learn programming languages like TypeScript, Python, JavaScript, SQL, and regular expressions. Interactive with real code examples.
🌐
Programiz
programiz.com › typescript › default-parameters
TypeScript Default Parameters
The default value of y is set to the x parameter. The default value of z is the sum of x and y. So when sum() is called without any arguments, it uses these default values, leading to the calculation 1 + 1 + 2 = 4. Hence, the output is 4. ... We can also pass a function as a default value in ...
🌐
Squash
squash.io › how-to-set-default-values-in-typescript
How to Set Default Values in TypeScript - Squash Labs
October 14, 2023 - In the above example, the Person interface defines the structure of an object with name and age properties. The greet function has a default parameter of type Person, which means if no object is provided when calling the function, it will use the default value of { name: "John Doe", age: 30 }. Related Article: Tutorial: Extending the Window Object in TypeScript
🌐
Byby
byby.dev › ts-function-parameters
TypeScript optional, nullable, and default parameters
May 9, 2023 - Note that default parameters are also considered optional by TypeScript, so you don’t need to add a ? after their names. However, unlike optional parameters, default parameters can come before required parameters in a function type.