Question: i did this but it dosen't work function var Destination = [ {name: 'Chicago', Miles: 329, Gallons: 10.6}, {name: 'St.Louis', Miles: 284, Gallons: 10.5}, {name:
i did this but it dosen't work
var Destination = [ {name: 'Chicago', Miles: 329, Gallons: 10.6}, {name: 'St.Louis', Miles: 284, Gallons: 10.5}, {name: 'Indianapolis', Miles: 122, Gallons: 3.7}, {name: 'Nashville', Miles: 191, Gallons:6.4}, {name: 'Cincinnati', Miles: 132, Gallons: 3.9} ]; window.onload = function() { document.getElementById('showData').onclick = function() { tbl = document.getElementById("dataTable"); for( i=0 < Distination; i++) { var temp = parseFloat ( Destination[i].Miles) / paseFloat( Destination[i].Gallons); var MPG = ( temp ).toFixed(1); var row = document.createElement("tr"); var rowTxt = "
Distination Data
| Destination | Miles | Gallon | MPG |
|---|
it should show as this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
