Nodejs Not Showing Full Data to Front End? ? Json transmission

  node.js, question

First of all, thank you for helping me look at this problem. Thank you very much.

Describe the problem

  1. The Express framework of Node.js is adopted as a whole.

  2. I read a comment object of an answer (answerComment) and then read the author’s information (also an object) of the comment according to its author’s IDauthor)

  3. = author;, assign a value, and then pass theconsole.log(;The value of author is displayed.

  4. But throughres.status(200).json({comment: answerComment});This sentence is passed at the front end when transmitting data to the front end.var response = JSON.parse(request.responseText);After obtaining the response, use theconsole.log( isundefined, outputconsole.log(response.answerComment)The data of is data, the form is as follows:


My question is why after assigning a value to an object, the output of the object can be displayed at the back end, but it cannot be displayed at the front end. Is it undefined? ? ? ? ?

response.anserCommentThis object is not withoutauthorIs it? Onlyauthor_id~~