I have a JSON object that I am trying to output as HTML by creating a function that returns a String template literal that iterates over the JSON and creates a list of properties and values from the JSON, but the returned value is a comma for every iteration (there are 12 iterations), what is wrong with my syntax that would cause this?
Thanks, but I am still only getting the 12 commas in the list. Why would I need to return? the map() function returns an array by itself correct? Also, would it matter that most of the properties have spaces and question marks, and that some of the values are URLs within the JSON?
I can console.log(<li>${prop}: ${value}</li>) and see the correct output, but the file I am creating using the “fs” module, only has the other HTML around ‘,’. like this:
Maybe that’s why I am not seeing the <div class="submission"><ul>; in the first map. I can’t share the csv/JSON, as it has private data, but like I said, the console.log(<li>${prop}: ${value}</li>); displays all the correct properties and values, so I don’t understand why the following return <li>${prop}: ${value}</li>; doesn’t display in the returned HTML.
Thanks, SOO much!! It was the missing the returns on the map functions. It is working great now. You are a lifesaver, and I learned something too. Have a great evening!