You can assign it a valid variable name using this syntax:
var {"my name": myName, age} = obj2;
// use myName here
More Related Contents:
- Types in object destructuring
- Typescript: How can I make entries in an ES6 Map based on an object key/value type
- How to avoid imports with very long relative paths in Angular 2?
- What does “… resolves to a non-module entity and cannot be imported using this construct” mean?
- Typescript: Cannot use import statement outside a module
- How excess property check helps?
- Expression ___ has changed after it was checked
- Interfaces vs Types in TypeScript
- Could not find a declaration file for module ‘module-name’. ‘/path/to/module-name.js’ implicitly has an ‘any’ type
- TypeScript conditional types – filter out readonly properties / pick only required properties
- Typescript: infer type of generic after optional first generic
- Define global constants
- Create an enum with string values
- Typescript: TS7006: Parameter ‘xxx’ implicitly has an ‘any’ type
- Disallow call with any
- Why is Event.target not Element in Typescript?
- Angular2 handling http response
- Get list of duplicate objects in an array of objects
- How to ‘map’ a Tuple to another Tuple type in Typescript 3.0
- Extend (Update) third-party old type declaration interface with new one
- Derive union type from tuple/array values
- Is it possible to generate string literal combinations with template literal in TypeScript?
- Test for array of string type in TypeScript
- Can’t narrow the type of an object property even after checking it with a type guard
- Typescript narrowing of keys in objects when passed to function
- What do square brackets mean where a field should be in typescript?
- How to update TypeScript to latest version with npm?
- Typescript: Spread types may only be created from object types
- Why TypeScript lets me add a string and a number? Can I prevent it?
- A way to mark arbitrary strings in Typescript Template Literals