Now that we understand how to make a script call to fetch an external JavaScript file, let us use the same technique to import a JSON feed. I have generated a test employee JSON data feed with 100 records. To traverse through any JSON feed, it is important to make a note of how the data is arranged. The keys in this data feed are basic employee information such as employee number, date of birth, first name, last name, gender, hire date, titles that they have held, and the dates during which they have held those titles. A few employees have held the same title throughout their tenure, while there are some employees who have held more than one title.
This JSON file will be part of the code files for exercises.
Consider the following JSON store that we need to use to perform the operations:
let data_json = [
{
"emp_no" : "10001",
...