You're given a JSON array of Illinois Cities. With this list, your task is to build out a function that accepts a string and returns back cities that contain the given characters. The function should accept another parameter to limit the amount of matches it returns. The results should be returned in alphabetical order with priority given to matches that start with the characters.
Use your language or framework of choice, and store the data in any fashion you'd like, as long as it's web friendly.
[
"Summit", "Palatine", "Naperville", "North Chicago", "Springfield",
"Arlington Heights", "Oak Park", "Moline", "Calumet City", "Ottawa",
"Wood River", "Oregon", "Herrin", "Brookfield", "Kankakee", "Des Plaines",
"Cahokia", "Galesburg", "Macomb", "Libertyville", "Effingham", "Petersburg",
"Elmhurst", "Aurora", "Danville", "Decatur", "Rockford", "Charleston",
"Park Ridge", "Arthur", "Park Forest", "Cicero", "Champaign", "Mount Vernon",
"Virden", "Shawneetown", "Kaskaskia", "Cairo", "Chicago Heights", "Carthage",
"Harrisburg", "Pekin", "Carlinville", "Joliet", "Collinsville", "Galena",
"Bloomington", "Granite City", "Normal", "South Holland", "Evanston",
"Rantoul", "East Moline", "Glenview", "Lake Forest", "DeKalb", "Belleville",
"Waukegan", "Nauvoo", "Quincy", "Wheaton", "Wilmette", "River Forest",
"La Salle", "Monmouth", "Kewanee", "Glen Ellyn", "Highland Park", "Centralia",
"East Saint Louis", "Skokie", "Dixon", "Mundelein", "Rock Island", "Salem",
"Mattoon", "Pontiac", "Belvidere", "Lisle", "Elgin", "Alton", "Urbana",
"Lincoln", "Carbondale", "Winnetka", "Chester", "Canton", "Zion", "Chicago",
"Streator", "Peoria", "Freeport", "Lombard", "Vandalia", "Jacksonville"
]
Write a unit test that covers the functionality you wrote in part 1.
Turn your function into an api endpoint!