Web Development TypeScript Mcq
Oct 04, 2025

What is the correct way to implement a recursive conditional type?

Choose the correct answer:
A) type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }
B) type DeepReadonly<T> = T extends object ? { readonly [P in keyof T]: DeepReadonly<T[P]> } : T
C) type DeepReadonly<T> = { [P in keyof T]: readonly T[P] }
D) type DeepReadonly<T> = readonly T
Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback