Interactive online courses HTML Academy
2026-03-09 12:55 Diff
  • script.js

JavaScript

// Copy the whole code below var percent = 0.25; var distance = 4125; if (distance > 10500) { percent = 0.35; } var miles = distance * percent; console.log('We’ll get ' + miles + ' miles for the flight to Irkutsk'); // Paste the code after this comment

Thanks! We’ll fix everything at once!

Result

  1. Copy the entire code written before and paste it into the editor after the existing code.
  2. Change the second message in the console to 'We’ll get ' + miles + ' miles for the flight to Kamchatka'.
  3. Set value 11000 to the second variable distance.