type Keys = 'option1' | 'option2';
type Flags1 = { [K in Keys]: boolean };
// Flags1はFlags2と等しい
type Flags2 = { option1: boolean; option2: boolean;}
let key = 'name'
let obj={key:'jack'} =>{key:jack}
// [key]:変数keyの値を読み取る
let obj={[key]:'jack'} =>{name:jack}
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme