Answer the question
In order to leave comments, you need to log in
How to get only fields of the same type from an object in Typescript?
type A = {
a: number
}
type B = {
b: number
}
type C = {
c: number
}
interface ABC extends A, B, C {
abc: number
}
const obj: ABC = {
a: 1,
b: 2,
c: 3,
abc: 4
}
const objA: A = obj
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question