Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 2.81 KB

File metadata and controls

13 lines (8 loc) · 2.81 KB

Tuple to Object easy #object-keys

by sinoon @sinoon

Take the Challenge    简体中文 日本語 한국어

Given an array, transform it into an object type and the key/value must be in the provided array.

For example:

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

type 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

Related Challenges

10・Tuple to Union 472・Tuple to Enum Object 730・Union to Tuple 3188・Tuple to Nested Object