fix(guide): Remove repl.it links from challenge related guide articles (English) (#36204)
* fix: remove repl.it links english * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add extra line Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@@ -53,8 +53,6 @@ function testSize(num) {
|
||||
}
|
||||
```
|
||||
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Chaining-ifelse-statements)
|
||||
|
||||
### Code explanation
|
||||
The function first checks the `if` condition `(num < 5)`. If it evaluates to `true`, it returns the statement between the curly braces ("Tiny"). If it doesn't, it checks the next condition until the last `else` statement.
|
||||
|
||||
|
@@ -30,7 +30,6 @@ function testEqual(val) {
|
||||
testEqual(10);
|
||||
|
||||
```
|
||||
· [Run code at repl.it](https://repl.it/@AdrianSkar/Basic-JS-Equality-operator)
|
||||
|
||||
### Code explanation
|
||||
The function first evaluates `if` the condition `(val == 12)` evaluates to `true`. If it does, it returns the statement between the curly braces ("Equal"). If it doesn't, it returns the next `return` statement outside them ("Not equal").
|
||||
|
@@ -30,7 +30,6 @@ function testNotEqual(val) {
|
||||
// Change this value to test
|
||||
testNotEqual(10);
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Comparison-with-the-inequality-operator).
|
||||
|
||||
### Code explanation
|
||||
The function first evaluates `if` the condition `(val != 99)` evaluates to `true`. If it does, it returns the statement between the curly braces ("Not equal"). If it doesn't, it returns the next `return` statement outside them ("Equal").
|
||||
|
@@ -37,7 +37,6 @@ function testLogicalAnd(val) {
|
||||
// Change this value to test
|
||||
testLogicalAnd(10);
|
||||
```
|
||||
· [Run code at repl.it](https://repl.it/@AdrianSkar/Basic-JS-Comparison-with-the-and-operator)
|
||||
|
||||
### Code explanation
|
||||
The function first evaluates `if` the condition `val <= 50` evaluates to `true` converting `val` to a number if necessary, then does the same with `val >=25` because of the logical AND (`&&`) operator; if both return true, the `return "Yes"` statement is executed.
|
||||
|
@@ -118,7 +118,6 @@ function cc(card) {
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Counting-cards).
|
||||
|
||||
### Code explanation
|
||||
· The function first evaluates `if` the condition `card` is a value greater than `1` and lower than `7`, in which case it increments `count` by one.
|
||||
|
@@ -27,7 +27,6 @@ function randomRange(myMin, myMax) {
|
||||
|
||||
}
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Random-whole-numbers-within-range).
|
||||
|
||||
### Code explanation
|
||||
- `Math.random()` generates our random number between 0 and ≈ 0.9.
|
||||
|
@@ -110,7 +110,6 @@ function golfScore(par, strokes) {
|
||||
// Change these values to test
|
||||
golfScore(5, 4);
|
||||
```
|
||||
·Run at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Golf-code)
|
||||
|
||||
## Code explanation
|
||||
Since we already have an array defined in the variable `names` we can take advantage of it and use it for our return statements using indexes (eg: `names[0] is the first one`). That way, if you ever need to change a specific result you wouldn't need to look for it inside the function, it'd be at the beginning, in your array.
|
||||
@@ -129,7 +128,6 @@ Since we already have an array defined in the variable `names` we can take advan
|
||||
"Change Me";
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/@greggubarev/Basic-JS-Golf-code1' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Resources
|
||||
|
||||
|
@@ -71,7 +71,7 @@ function testElseIf(val) {
|
||||
// Change this value to test
|
||||
testElseIf(7);
|
||||
```
|
||||
:rocket: [Run code](https://repl.it/@RyanPisuena/GoldenWorriedRuntime)
|
||||
|
||||
## Code explanation
|
||||
The structure of an **else-if logic flow** is an initial `if` statement, one more `if-else` statements, and one final `else` statement.
|
||||
|
||||
|
@@ -42,7 +42,6 @@ function testElse(val) {
|
||||
// Change this value to test
|
||||
testElse(4);
|
||||
```
|
||||
· [Run code at repl.it](https://repl.it/@AdrianSkar/Introducing-else-statements)
|
||||
|
||||
### Code explanation
|
||||
The function first evaluates `if` the condition `val > 5` evaluates to `true`. If it doesn't, it executes the next statement (`else { return "5 or smaller";})`.
|
||||
|
@@ -83,7 +83,6 @@ function sequentialSizes(val) {
|
||||
// Change this value to test
|
||||
sequentialSizes(1);
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Multiple-opts-in-switch).
|
||||
|
||||
### Code explanation
|
||||
Since you already have a variable named `answer` defined and the function returns it, you can just modify its value on each group of case statements to fit the exercise requirements.
|
||||
|
@@ -98,7 +98,6 @@ for (var i = 0; i < contacts.length; i++){
|
||||
return "No such contact";
|
||||
}
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Profile-lookup).
|
||||
|
||||
### Code explanation
|
||||
This works as the last example but uses the `in` operator to look for `prop` instead of the `hasOwnProperty()` method.
|
||||
|
@@ -70,7 +70,6 @@ To access the value of a key in this object, you will use `collection[id][prop]`
|
||||
return collection;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/C2AZ/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -38,7 +38,5 @@ function isLess(a, b) {
|
||||
isLess(10, 15);
|
||||
```
|
||||
|
||||
Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-Js-Returning-boolean-from-function).
|
||||
|
||||
### Resources
|
||||
- ["Less than or equal operator (<=)" - *MDN JavaScript Reference*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Less_than_or_equal_operator_(%3C))
|
||||
|
@@ -105,7 +105,6 @@ function caseInSwitch(val) {
|
||||
// Change this value to test
|
||||
caseInSwitch(1);
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Switch-statements).
|
||||
|
||||
### Code explanation
|
||||
Since you already have a variable defined at the beginning of the function named `answer` and it's defined as the last return statement, you can assign new values to it for each case and will return the expected answer depending on the value you pass to the function.
|
||||
|
@@ -28,7 +28,6 @@ function convertToInteger(str) {
|
||||
}
|
||||
convertToInteger("10011");
|
||||
```
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-JS-Use-parseInt-with-radix).
|
||||
|
||||
### Code explanation
|
||||
- The function takes `str` and returns an integer instead of a string but "understanding" its a binary number instead of a decimal one thanks to the `radix` parameter (2).
|
||||
|
@@ -66,7 +66,6 @@ After converting our case statements into object properties you can make use of
|
||||
result = lookup[val];
|
||||
```
|
||||
|
||||
· Run code at [repl.it](https://repl.it/@AdrianSkar/Using-objects-for-lookups).
|
||||
|
||||
### Resources
|
||||
|
||||
|
Reference in New Issue
Block a user