Create a file index.js
in the names directory.
Write a JS function in index.js
with function name getPeopleInCity
that accepts people names list and returns an array of containing the first names of the people.
Export the function using the default export syntax.
Folder Structure
country
- state
- city
- index.js // contains the people names list
utilities
- utils
- index.js // contains a function that returns the first names of the people
names
- index.js // create the file and write your code here
Use the given modules.
Use Common JS module syntax.