JavaScript Displaying the Content

Why does he have to use data.message in this video instead of just data?

Why does he have to target the message property?

1 Answer

Steven Parker
Steven Parker
206,336 Points

The API delivers a "data" object containing multiple attributes. The "message" attribute contains the URL of the image to be displayed, which is selected by this code and passed to the function to format the output.