Learn Node-SQLite


I really need help with instruction 5. It says "Log these averages using the given printQueryResults() function. I do not see how I am making an error. I seem to be doing it correctly. My code is on line 12. I am on "Learn Node-SQLite". I am on exercise "Using db.each()".

const { addClimateRowToObject, calculateAverages, printQueryResults } = require('./utils');
const sqlite = require('sqlite3');

const db = new sqlite.Database('./db.sqlite');

const temperaturesByYear = {};
db.each('SELECT * FROM TemperatureData',
       (error, row) => {
  addClimateRowToObject(row, temperaturesByYear);
const averageTemperatureByYear = calculateAverages(temperaturesByYear),


As with your previous topic, we will be needing the URL of the exercise page. Please.post it in a reply. Thanks.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.