UFO-level-1/static/js/app.js
// Looping through data file to add keys and their values to the table
Looping through data file to add keys and their values to the table
Looping through data file to add keys and their values to the table
function displayData(data){ 
    tbody.text("")
    data.forEach(function(sighting){
    new_tr = tbody.append("tr")
    Object.entries(sighting).forEach(function([key, value]){
        new_td = new_tr.append("td").text(value)	
    })
})}
function displayData ( data ) { tbody . text ( "" ) data . forEach ( function ( sighting ) { new_tr = tbody . append ( "tr" ) Object . entries ( sighting ) . forEach ( function ( [ key , value ] ) { new_td = new_tr . append ( "td" ) . text ( value ) } ) } ) }
Looping through data file to add keys and their values to the table
Looping through data file to add keys and their values to the table