I'm working on a project in NextJS and I found an interesting problem for which I can't seem to find a solution - I have an array of objects I've acquired from the Civic GAPI. In this array, most the objects are general election contests, but some are also referendums. The contest and referendum objects have different structures. Here's a general election contest object: 14: candidates: (2) [{…}, {…}] district: {name: "Thurston County", scope:...
Originally asked by Avery Freeman on Stack Exchange (stackoverflow) (CC BY-SA 4.0).