To extract data retrieved from an API first implement a GET request through JavaScript's fetch function to a desired API endpoint.
In our example our endpoint is /posts
Once the data is brought into your local application use an indexed bracket notation "[0]" to access the desired post.
If access to the post has been achieved, then use the dot operator "." to extract the "body" property.
Accordingly, the data value will be accessible to be used throughout the application. In this specific use case, we render the data on to the user interface.
If you need a refresher on how a GET request works check out the link below:
• Execute an API GET request with JavaScript
Best,
Fido
-----------------------------------------------------------------------------------------
Book a private technical consultation 💻:: https://selftaughthustle.net
Follow me on instagram 📸 : @selftaughthustle
Build a software solution for your business entity 💼:: https://guavalabs.io
Check out Guava Lab's YouTube 📺:: https://www.youtube.com/channel/UCHa8
*/