Answer the question
In order to leave comments, you need to log in
Can TS get array values?
const names = ["иван", "антон"]
const fn = (name) => name
Answer the question
In order to leave comments, you need to log in
const names = ["иван", "антон"] as const
const fn = (name: typeof names[0]) => name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question