How to fetch posts from WordPress Rest API using pure javascript without libray or framework
We are using javascript fetch() api to fetch posts from the WordPress Rest API.
fetch() api returns Promise() so I have decided to use async/await instead of callback. So that I can easily assign responsed data from the WP Rest API to the local arrays and reuse them.