Using the JSON Placeholder API [https://jsonplaceholder.typicode.com/], complete the following problems using either fetch and then methods, or async/await. Add event handling as well!
-
Create a function,
getCompleted
, that returns those that have completed tasks. -
Create a function,
getUncompleted
, that returns those that have uncompleted tasks. -
Create a function,
userIdTasks
, that takes in a user ID and returns all of their tasks, both completed and uncompleted. -
Create a function,
idTask
, that takes in an id and returns that task's title. -
Create a function,
urgentTitle
, that returns all task titles with uppercase letters. -
Create a function,
getPost
, that takes in an id and returns that post. -
Create a function,
userPosts
, that takes in a user ID and returns all the posts from that user. -
Create a function,
longestTitle
, that returns the post with the longest title. -
Create a function,
identify
, that returns an array with this format: "User (user's ID): (title)" -
Create a function,
getUsername
, that takes in a username and returns the user that matches that username.