fix: Correct paths in English exercises by prefixing "/" before "learn" (#38099)
* fix: Correct paths in English exercises by prefixing "/" before "learn" * fix(lang): Correct paths to exercises by prefixing "/" before "learn" in remaining languages
This commit is contained in:
committed by
Randell Dawson
parent
66631812fa
commit
fda7fb174e
@ -8,7 +8,7 @@ forumTopicId: 16658
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
If you'll recall from our discussion of <a href="learn/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator" target="_blank">Storing Values with the Assignment Operator</a>, everything to the right of the equal sign is resolved before the value is assigned. This means we can take the return value of a function and assign it to a variable.
|
||||
If you'll recall from our discussion of <a href="/learn/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator" target="_blank">Storing Values with the Assignment Operator</a>, everything to the right of the equal sign is resolved before the value is assigned. This means we can take the return value of a function and assign it to a variable.
|
||||
Assume we have pre-defined a function <code>sum</code> which adds two numbers together, then:
|
||||
<code>ourSum = sum(5, 12);</code>
|
||||
will call <code>sum</code> function, which returns a value of <code>17</code> and assigns it to <code>ourSum</code> variable.
|
||||
|
@ -10,7 +10,7 @@ forumTopicId: 18185
|
||||
<section id='description'>
|
||||
Random numbers are useful for creating random behavior.
|
||||
JavaScript has a <code>Math.random()</code> function that generates a random decimal number between <code>0</code> (inclusive) and not quite up to <code>1</code> (exclusive). Thus <code>Math.random()</code> can return a <code>0</code> but never quite return a <code>1</code>
|
||||
<strong>Note</strong><br>Like <a href='learn/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator' target='_blank'>Storing Values with the Equal Operator</a>, all function calls will be resolved before the <code>return</code> executes, so we can <code>return</code> the value of the <code>Math.random()</code> function.
|
||||
<strong>Note</strong><br>Like <a href='/learn/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator' target='_blank'>Storing Values with the Equal Operator</a>, all function calls will be resolved before the <code>return</code> executes, so we can <code>return</code> the value of the <code>Math.random()</code> function.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
|
@ -16,9 +16,9 @@ There are several rules for handling incomplete data:
|
||||
If <code>prop</code> is <code>"tracks"</code> but the album doesn't have a <code>"tracks"</code> property, create an empty array before adding the new value to the album's corresponding property.
|
||||
If <code>prop</code> is <code>"tracks"</code> and <code>value</code> isn't empty (<code>""</code>), push the <code>value</code> onto the end of the album's existing <code>tracks</code> array.
|
||||
If <code>value</code> is empty (<code>""</code>), delete the given <code>prop</code> property from the album.
|
||||
<strong>Hints</strong><br>Use <code>bracket notation</code> when <a href="learn/javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables" target="_blank">accessing object properties with variables</a>.
|
||||
<strong>Hints</strong><br>Use <code>bracket notation</code> when <a href="/learn/javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-variables" target="_blank">accessing object properties with variables</a>.
|
||||
Push is an array method you can read about on <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push" target="_blank">Mozilla Developer Network</a>.
|
||||
You may refer back to <a href="learn/javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects" target="_blank">Manipulating Complex Objects</a> Introducing JavaScript Object Notation (JSON) for a refresher.
|
||||
You may refer back to <a href="/learn/javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects" target="_blank">Manipulating Complex Objects</a> Introducing JavaScript Object Notation (JSON) for a refresher.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
|
@ -8,7 +8,7 @@ forumTopicId: 18273
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
You may recall from <a href="learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator" target="_blank">Comparison with the Equality Operator</a> that all comparison operators return a boolean <code>true</code> or <code>false</code> value.
|
||||
You may recall from <a href="/learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator" target="_blank">Comparison with the Equality Operator</a> that all comparison operators return a boolean <code>true</code> or <code>false</code> value.
|
||||
Sometimes people use an if/else statement to do a comparison, like this:
|
||||
|
||||
```js
|
||||
|
Reference in New Issue
Block a user