How to abstract your code with vanilla JS
One of the biggest challenges I hear about from developers is that they struggle with how to abstract their code. Today, we’re going to look at a few different examples using the fetch() method, and I’ll show you how I would abstract that code. Repeating the same task For today’s article, we’ll be using the JSONPlaceholder APIs. They let you make real API calls and get data back. For our first example, lets say you wanted to POST data to the /posts endpoint.