Interactive online courses HTML Academy
2026-03-09 10:46 Diff
  • script.js

JavaScript

var expectedUsers = 1000; var firstDayUsers = 812; var secondDayUsers = 1360; var thirdDayUsers = 657; var fourthDayUsers = 1247; // Drawing the traffic graph muffin.plot( firstDayUsers, secondDayUsers, thirdDayUsers, fourthDayUsers, expectedUsers ); // Calculating the average traffic value var averageUsers = (firstDayUsers + secondDayUsers + thirdDayUsers + fourthDayUsers) / 4; console.log('Average traffic: ' + averageUsers); if (averageUsers > expectedUsers) { console.log('Traffic is amazing. Keep up the good work!'); } else { console.log('Traffic is so-so. You need to try harder!'); }

Thanks! We’ll fix everything at once!

Result

  1. Instead of calculating the average value, assign the variable averageUsers value 0.
  2. Before the muffin.plot() command, add variable usersByDay with value [812, 1360, 657, 1247].
  3. Inside muffin.plot(), set usersByDay as first parameter, expectedUsers as second parameter and delete the remaining parameters.
  4. Feel free to delete variables firstDayUsers, secondDayUsers, thirdDayUsers and fourthDayUsers.