HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>The function is ready, and then what? How do we calculate the number of miles?</p>
1 <p>The function is ready, and then what? How do we calculate the number of miles?</p>
2 <p>In order for the function to begin its work, it must be called. To do this, we will need the name of the function. We’ll use it to call our function and ask it to execute its code.</p>
2 <p>In order for the function to begin its work, it must be called. To do this, we will need the name of the function. We’ll use it to call our function and ask it to execute its code.</p>
3 <p>If we just log function console.log(functionName), we’ll see in the console the entire code of this function in approximately the same form as it was written, but no calculations will occur.</p>
3 <p>If we just log function console.log(functionName), we’ll see in the console the entire code of this function in approximately the same form as it was written, but no calculations will occur.</p>
4 <p>So how do you run the code from the function body?</p>
4 <p>So how do you run the code from the function body?</p>
5 <p>You need to call the function by its name, and then use the parentheses.</p>
5 <p>You need to call the function by its name, and then use the parentheses.</p>
6 functionName();<p>Note that functions called this way must be defined before they are called.</p>
6 functionName();<p>Note that functions called this way must be defined before they are called.</p>
7 <p>Let’s check how the function call works and call our calculateMiles function.</p>
7 <p>Let’s check how the function call works and call our calculateMiles function.</p>