Skip to content

Commit

Permalink
Drop double space that gets rendered in “Function return values” (mdn…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomayac committed Jun 10, 2021
1 parent a39b00b commit 8fadb5f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2 id="What_are_return_values">What are return values?</h2>

<p>If you look at the <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace">replace()</a></code> function MDN reference page, you'll see a section called <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#return_value">return value</a>. It is very useful to know and understand what values are returned by functions, so we try to include this information wherever possible.</p>

<p>Some functions don't return any value. (In these cases,  our reference pages list the return value as <code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/void">void</a></code> or <code><a href="/en-US/docs/Glossary/undefined">undefined</a></code>.) For example, in the <a href="https://github.com/mdn/learning-area/blob/master/javascript/building-blocks/functions/function-stage-4.html#L50"><code>displayMessage()</code></a> function we built in the previous article, no specific value is returned when the function is invoked. It just makes a box appear somewhere on the screen — that's it!</p>
<p>Some functions don't return any value. (In these cases, our reference pages list the return value as <code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/void">void</a></code> or <code><a href="/en-US/docs/Glossary/undefined">undefined</a></code>.) For example, in the <a href="https://github.com/mdn/learning-area/blob/master/javascript/building-blocks/functions/function-stage-4.html#L50"><code>displayMessage()</code></a> function we built in the previous article, no specific value is returned when the function is invoked. It just makes a box appear somewhere on the screen — that's it!</p>

<p>Generally, a return value is used where the function is an intermediate step in a calculation of some kind. You want to get to a final result, which involves some values that need to be calculated by a function. After the function calculates the value, it can return the result so it can be stored in a variable; and you can use this variable in the next stage of the calculation.</p>

Expand Down

0 comments on commit 8fadb5f

Please sign in to comment.