Not currently.
You can return an object that can contain more than one property.
return { k1: 5, k2: 99 };
You can combine this with destructuring so the intermediate object becomes invisible…
function myFunction() {
return { k1: 5, k2: 99 };
}
const { k1, k2 } = myFunction();
console.log(k1);
console.log(k2);
You could also achieve the same with a tuple, but this is pretty readable.
Related Contents:
- ‘unknown’ vs. ‘any’
- How to suppress “error TS2533: Object is possibly ‘null’ or ‘undefined'”?
- How to reject in async/await syntax?
- Get an object’s class name at runtime
- In Typescript, How to check if a string is Numeric
- “parserOptions.project” has been set for @typescript-eslint/parser
- Iterating over Typescript Map
- TypeScript empty object for a typed variable
- TypeScript and field initializers
- Typescript Interface – Possible to make “one or the other” properties required?
- Create a global variable in TypeScript
- Typescript has unions, so are enums redundant?
- Returning a promise in an async function in TypeScript
- What does enclosing a class in angle brackets “” mean in TypeScript?
- Is it possible to use a readonly property in TypeScript Interfaces? [duplicate]
- TypeScript function return type based on input parameter
- TypeScript 2.8.3 Type must have a Symbol.iterator method that returns an iterator
- How can I check whether an optional parameter was provided?
- Is it possible to use `keyof` operator on literals instead of interfaces?
- Difference between ‘object’ ,{} and Object in TypeScript
- How to define string literal union type from constants in Typescript
- Accessing a property in a parent Component
- What does !: mean in Typescript?
- Why am I getting “Type ‘String’ cannot be used as an index type” error in TypeScript?
- Disable TSLint in VSCode
- how to debug typescript files in visual studio code
- tsc.ps1 cannot be loaded because running scripts is disabled on this system
- Using jQuery plugin in TypeScript
- When is it appropriate to use a semicolon?
- Use of never keyword in typescript
- Initialize a Map containing arrays in TypeScript
- Webpack cant compile ts 3.7 (Optional Chaining, Nullish Coalescing)
- how to change page title in angular2 router
- Angular 2 ngModel in child component updates parent component property
- Why use babel-loader with ts-loader?
- How to define Object of Objects type in typescript
- Flatten array of arrays in TypeScript
- How to iterate a string literal type in typescript
- NextRouter was not mounted Next.JS
- How to get current date and time in TypeScript
- What means “ambient” in TypeScript
- How check if Vue is in development mode?
- How to mock React Navigation’s navigation prop for unit tests with TypeScript in React Native?
- required url param on React router v5 with typescript, can be undefined
- Prettier is not indenting as specified
- typescript – can tsc be run against an entire folder?
- TypeScript: Global static variable best practice
- How can I change a readonly property in TypeScript?
- What exactly $event object do in Angular 2?
- How do I get around this “Subject incorrectly extends Observable” error in TypeScript 2.4 and RxJS 5.x?