Interview Prep Quiz Practice
Active Recall Drill Session
← Exit SessionQuestion 1 of 1
mediumInterview Prep
What is the output of flattenComments (from Implement It Yourself) for a single top-level comment with one nested reply, in terms of the 'depth' field values produced?
code
flattenComments([{ id: 1, text: 'a', replies: [{ id: 2, text: 'b', replies: [] }] }]);