Back to problems

Implement comment sorting and nesting

Object-Oriented Programming · Bobyard · Medium

You are given a flat array of mock comment records that are already available locally. Each record has: id: unique identifier for the comment userId: identifier of the author timestamp: numeric creation time content: text of the comment parentId: identifier of the parent comment, or null for a top-level comment Implement the frontend behavior for a threaded comment UI. The UI must allow sorting by either timestamp or userId, in both ascending and descending order. The…

Checking your access…