Complete this javascript file according to the individual instructions given in the comments. *** DO NOT CHANGE any of the code that you are not instructed to. */ //////////////////////// // NOTE: Use the API endpoints available at // https://jsonplaceholder.typicode.com/ // to get the data required in these exercises. // HINT: Read the documented Resources and Routes. // Also the guide: // https://jsonplaceholder.typicode.com/guide/ /////////////////////// Create a function named "getComments". // This function needs to accept a "postID" // parameter. // Use Fetch with Async/Await to request // all the comments for the postID that // is passed in as a parameter. // The function should return all the // comments for the requested postID // as JSON data.
Complete this javascript file according to the individual instructions
given in the comments.
*** DO NOT CHANGE any of the code that you are not instructed to. */
////////////////////////
// NOTE: Use the API endpoints available at
// https://jsonplaceholder.typicode.com/
// to get the data required in these exercises.
// HINT: Read the documented Resources and Routes.
// Also the guide:
// https://jsonplaceholder.typicode.com/guide/
///////////////////////
Create a function named "getComments".
// This function needs to accept a "postID"
// parameter.
// Use Fetch with Async/Await to request
// all the comments for the postID that
// is passed in as a parameter.
// The function should return all the
// comments for the requested postID
// as JSON data.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images