0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<ul><li>script.js</li>
1
<ul><li>script.js</li>
2
</ul><p>JavaScript</p>
2
</ul><p>JavaScript</p>
3
<p>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'); // Delete the code below var percent = 0.25; var distance = 11000; if (distance > 10500) { percent = 0.35; } var miles = distance * percent; console.log('We’ll get ' + miles + ' miles for the flight to Kamchatka');</p>
3
<p>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'); // Delete the code below var percent = 0.25; var distance = 11000; if (distance > 10500) { percent = 0.35; } var miles = distance * percent; console.log('We’ll get ' + miles + ' miles for the flight to Kamchatka');</p>
4
<p>Thanks! We’ll fix everything at once!</p>
4
<p>Thanks! We’ll fix everything at once!</p>
5
<h2>Result</h2>
5
<h2>Result</h2>
6
<ol><li>Delete<strong>the entire</strong>code for calculating the miles of the second flight (variables, condition and log in the console).</li>
6
<ol><li>Delete<strong>the entire</strong>code for calculating the miles of the second flight (variables, condition and log in the console).</li>
7
<li>Add function declaration for counting miles at the end of the program: var calculateMiles = function () { };.</li>
7
<li>Add function declaration for counting miles at the end of the program: var calculateMiles = function () { };.</li>
8
<li>Transfer the entire remaining code calculating miles into the body of the calculateMiles function.</li>
8
<li>Transfer the entire remaining code calculating miles into the body of the calculateMiles function.</li>
9
</ol>
9
</ol>