Let’s look at the title:

const data = [
		{
			"_id": "2d44d6c26110d22203f5fbf95484b816"."comment_content": "Test review"."article_id": "cd045e756102b0b600e6153e7dc3e678"."comment_author": {
				"name": "User 97.89556629736191"."email": "User 52.8973290551612 @github.com"}}, {"_id": "14139e126110d75503f2df4a0354e831"."comment_content": "Comment Number two."."article_id": "cd045e756102b0b600e6153e7dc3e678"."comment_author": {
				"name": "User 27.064798298154493"."email": "User 97.70539438271202 @github.com"}}, {"_id": "cd045e7561121d9404c02e1a61856780"."comment_content": "Great Sada"."article_id": "8937eaa96102b10200bc97bd4e2c6183"."comment_author": {
				"name": "User 45.88242116867542"."email": "User 36.95435829054714 @github.com"}}, {"_id": "14139e1261129806045420e93a9a9922"."comment_content": "Secondary review"."reply_content": "Secondary review"."pid": {
				"_id": "2d44d6c26110d22203f5fbf95484b816"."comment_content": "Test review"."article_id": "cd045e756102b0b600e6153e7dc3e678"."comment_author": {
					"name": "User 97.89556629736191"."email": "User 52.8973290551612 @github.com"}},"comment_author": {
				"name": "User 79.29663107058975"."email": "User 63.831949036364335 @github.com"}}] Copy the codeCopy the code

The output

const data = [
		{
			"_id": "2d44d6c26110d22203f5fbf95484b816"."comment_content": "Test review"."article_id": "cd045e756102b0b600e6153e7dc3e678"."comment_author": {
				"name": "User 97.89556629736191"."email": "User 52.8973290551612 @github.com"
			},
                        children: [{"_id": "14139e1261129806045420e93a9a9922"."comment_content": "Secondary review"."reply_content": "Secondary review"."pid": {
                                        "_id": "2d44d6c26110d22203f5fbf95484b816"."comment_content": "Test review"."article_id": "cd045e756102b0b600e6153e7dc3e678"."comment_author": {
                                            "name": "User 97.89556629736191"."email": "User 52.8973290551612 @github.com"}},"comment_author": {
                                        "name": "User 79.29663107058975"."email": "User 63.831949036364335 @github.com"}}]}, {"_id": "14139e126110d75503f2df4a0354e831"."comment_content": "Comment Number two."."article_id": "cd045e756102b0b600e6153e7dc3e678"."comment_author": {
				"name": "User 27.064798298154493"."email": "User 97.70539438271202 @github.com"
			},
                        children: []}, {"_id": "cd045e7561121d9404c02e1a61856780"."comment_content": "Great Sada"."article_id": "8937eaa96102b10200bc97bd4e2c6183"."comment_author": {
				"name": "User 45.88242116867542"."email": "User 36.95435829054714 @github.com"
			},
                        children: []},]Copy the code

Requirements:

Time 20 minutes, all the code all handwritten, can not use other than the native third party code.

Strengthen the version:

1. Tree table linkage. If you change one piece of data in a tree or table, you can change the other

The last

I hope you can give me the best solution, post it in the comments, and discuss with each other (after three cups of tea)