Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 1.55 KB

File metadata and controls

13 lines (8 loc) · 1.55 KB

Tuple to Object easy

by sinoon @sinoon

Take the Challenge    简体中文 日本語

Give an array, transform into an object type and the key/value must in the given array.

For example

const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const

const result: TupleToObject<typeof tuple> // expected { tesla: 'tesla', 'model 3': 'model 3', 'model X': 'model X', 'model Y': 'model Y'}

Back Share your Solutions Check out Solutions