Code QuizIntermediate Recursive Structure Type
Find why a nested category assignment fails against its type.
Codetypescript
interface Category {
name: string;
subcategories: Category;
}
const root: Category = {
name: "root",
subcategories: [{ name: "child", subcategories: [] }]
};What is the bug in this recursive interface?