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 - Default parameters are optional. To use the default initialized value of a parameter, you omit the argument when calling the function or pass the undefined into the function.
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
With a functin that has two arguments with default values, what is the best way to call this function with the default value for the first argument but with a new value for the second argument?
Using undefined as an argument value is the correct way to let the parameter get its default. Alternatively you can use an object for your optional parameters (similar to what InTheAtticToTheLeft suggested) which is a little more verbose - in a nice, named parameter kind of way - but doesn't require undefineds in place of unspecified parameters. function myFunc({argOne = 'one', argTwo = 'two'} = {}) { console.log(argOne, argTwo); } myFunc({argOne: 'newOne'}) // newOne two myFunc({argTwo: 'newTwo'}) // one newTwo The example above uses destructuring to allow the properties of the object to be seen as individual variables within the function body. The default empty object accounts for the case when no arguments are provided. myFunc() // one two More on reddit.com
🌐 r/learnjavascript
15
4
April 18, 2024
What's the cleanest way to build objects with many parameters in TS?
There are some very clean implementations of the builder pattern in TS, and even some npm packages which make it almost trivial This answer shows how to make a builder pattern with everything you mentioned: https://stackoverflow.com/a/53982272 More on reddit.com
🌐 r/typescript
17
12
May 1, 2019
how do I pass a default value if object is undefined
I don't really understand why you loosely Type something when the whol point of TS is to use strict typing. But assuming you have a genuine use case here you can assign defulat values when declaring properties inside the class. Like so export class Recipient { id: number = 1; email?: string = somedfault@email.com; } Here 1 will be assigned a default value to number and same goes for the email ass well. And if you pass in a value in the constructor during the instantiatio of the class that will override the id and the email. Do remeber to check and assign values in the constructor toneaxh of these properties else they will always default to the above values.👍 More on reddit.com
🌐 r/typescript
4
10
March 30, 2022
🌐
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 - Now that my object will only have default parameters I don’t need the rely on the interface anymore. Instead I’ll let TypeScript infer the types from the default values.
🌐
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 explore how default values for object properties streamline this process, step by step. Firstly, we destructure the person object parameter to gain direct access to its properties while also enabling default value assignment:
🌐
Bobby Hadz
bobbyhadz.com › blog › typescript-object-parameter-default-value
How to set Default Parameters in TypeScript | bobbyhadz
The getPerson function takes an object as a parameter, and the object has an optional property name. If the name property is not provided when calling the getPerson function, we default it to "Bobby". Note that it's very important to use the question mark to set the name property as optional. If the property is not set as optional, TypeScript will expect you to pass it every time you call the function.
🌐
Mimo
mimo.org › glossary › typescript › default-parameter
TypeScript Default Parameter: Syntax, Usage, and Examples
A TypeScript default parameter allows you to specify a fallback value for a function parameter when the caller does not provide an argument.
🌐
typescriptlang.org
typescriptlang.org › docs › handbook › 2 › functions.html
TypeScript: Documentation - More on Functions
If we want to describe something ... in an object type: ... Note that the syntax is slightly different compared to a function type expression - use : between the parameter list and the return type rather than =>. JavaScript functions can also be invoked with the new operator. TypeScript refers to ...
Find elsewhere
🌐
Delft Stack
delftstack.com › home › howto › typescript › typescript default parameter
Default Value for Object Parameters in TypeScript | Delft Stack
April 14, 2022 - This tutorial will focus on how default parameters can be used in TypeScript. A function can be defined to work with default values if, in case, no value is passed to the function.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-declare-parameters-with-default-values-in-typescript
How to Declare Parameters with Default Values in TypeScript
February 22, 2024 - Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
🌐
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.
🌐
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
🌐
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
🌐
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 - TypeScript function parameters allow you to define the types of the values that are passed into a function, which helps with type checking and improves code clarity. In addition to basic parameter syntax, TypeScript supports optional and default parameters, as well as nullable types.
🌐
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.
🌐
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....
🌐
Reddit
reddit.com › r/typescript › is there a way to have a default value for an object argument passed to a function?
r/typescript on Reddit: Is there a way to have a default value for an object argument passed to a function?
January 7, 2026 -
type OrderInfo = {
    quantity: number;
    productID: number;
    price: number;
    onSale: boolean
}


function order(orderInfo: OrderInfo): void { // I want onSale to default to true


}


order({quantity: 5, productID: 11, price: 5})

I want onSale to default to true in the order function so I don't have to mention it when calling it.

https://www.typescriptlang.org/play/?#code/C4TwDgpgBA8gTgEwnAkgOwGYHsoF4oDeAUFKVAI4CuAhmsAJagBcUalAtgEbIDcJZYOFgSUAxsBQARFmy69+pQfVEQZHbnD5koWNAGVqAG1VROWLMdpEAvkSIZKacfV07EyABRZ3qTFhbwSL7YAJQsAG5Y9AiEdrZE3kEeBFS0DMxQAKwANFCCwmIS0lAAjCW5SiosmdYhUAD09VAoUADuaTr6RtDAOEgY1JSGwFC9o3CUEHZAA

🌐
JavaScript in Plain English
javascript.plainenglish.io › named-typed-parameters-with-default-values-in-typescript-927ae5d6b6af
Named & Typed Parameters with Default Values in TypeScript | by Jeremy Brown | JavaScript in Plain English
January 13, 2025 - Before we go further into the TypeScript solution, let’s take a look at how and why this is helpful in Python. Below is an example of a geometric Line class. The constructor for this class accepts two Point objects. It’s simple and demonstrates that the constructor is expecting two arguments of type Point and that if either is missing, default to a specific value.
🌐
Medium
medium.com › @rare › setting-default-values-in-typescript-ac7f31482996
Setting Default Values in TypeScript | by rare. | Medium
May 14, 2024 - We define a default Superhero object (defaultSuperhero) and use it as the default parameter for the describeSuperhero function.
🌐
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.