As the long title says, this program script is created for properly gathering data from the restcountries.com api. If you don't know what is called the restcountries.com, it is a open api that is created for getting data regarding all the informations of the countries around the nation.
Of course that you can find this type of script anywhere on the internet. I just added my own revision. I got this idea from a JavaScript course. So I decided to turn it into reality.
When I was working with the data of the api in JSON, i lost my mind seeing the huge structure of it. As a novice, I spent time to create a script where the value will not come 'undefined'. That way, the user can input any data of a country's name and they don't need to say, "What does undefined mean?"
Also, I created this because I tend to forget things.
This is the demo of this script for your interest. It is shared on my twitter here.
There are other stuff to revise on this code as it is quite a mess.
- Fix the unnecessary codelines on the script.js and index.html
- Add codelines to ensure that all the languages of the target nation displays