Today we create a ‘Type Ahead’ feature. When you type something in the search bar, it will show all
the matched states/cities with the corresponding population.
The data is coming in from an external json file from a URL. The data (which is a huge array) needs
to be fetched and when someone types in the search box, it will show a subset of the cities/states.
In this task we learn about AJAX (Asynchronous JavaScript and XML). It is a web development technique used to communicate with
a server, without reloading the page.
The data is fetched using the browser’s Fetch API, which is an interface for fetching resources. According to
Mozilla’s MDN. The method takes one mandatory argument,
the path to the resource you want to fetch. It returns a Promise, which is an obejct used to handle asynchronous
operations in JS.