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:
@@ -46,7 +46,6 @@ This program is very simple, the trick is to understand what a boolean primitive
|
||||
// test here
|
||||
booWho(null);
|
||||
```
|
||||
 <a href='https://repl.it/CLnK/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
# Code Explanation:
|
||||
|
||||
|
@@ -67,7 +67,6 @@ Finally, we need a method to do the actual splitting and we can use `Array.slice
|
||||
return result;
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/CLjU/24' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -94,7 +93,6 @@ Finally, we need a method to do the actual splitting and we can use `Array.slice
|
||||
return arr2;
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/Cj9x/3' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -125,7 +123,6 @@ Finally, we need a method to do the actual splitting and we can use `Array.slice
|
||||
}
|
||||
chunkArrayInGroups(["a", "b", "c", "d"], 2);
|
||||
```
|
||||
 <a href='https://repl.it/CLjU/26' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -154,7 +151,6 @@ Finally, we need a method to do the actual splitting and we can use `Array.slice
|
||||
return newArr;
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/CLjU/579' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -181,7 +177,6 @@ Finally, we need a method to do the actual splitting and we can use `Array.slice
|
||||
}
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/repls/WideBriskMining' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -20,8 +20,6 @@ function confirmEnding(str, target) {
|
||||
confirmEnding("He has to give me a new name", "name");
|
||||
```
|
||||
|
||||
#### 🚀 [Run Code](https://repl.it/repls/SardonicRoundAfkgaming)
|
||||
|
||||
# Code Explanation:
|
||||
- First we use the `slice` method copy the string.
|
||||
- In order to get the last characters in `str` equivalent to the `target`'s length we use the `slice` method.
|
||||
|
@@ -143,6 +143,7 @@ function factorialize(num, factorial = 1) {
|
||||
|
||||
factorialize(5);
|
||||
```
|
||||
|
||||
#### Code Explanation:
|
||||
|
||||
In this solution, we use <a href='https://stackoverflow.com/questions/33923/what-is-tail-recursion' target='_blank' rel='nofollow'>Tail Recursion</a> to optimize the the memory use.
|
||||
|
@@ -49,7 +49,6 @@ function bouncer(arr) {
|
||||
return newArray;
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/repls/WarmPlainWebportal' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
We create a new empty array.
|
||||
@@ -71,7 +70,6 @@ We return the new array (newArray).
|
||||
return arr.filter(Boolean);
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/CLjU/32' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -50,7 +50,6 @@ Remember how to get the length of elements on the array? `Array[index].length`.
|
||||
return maxLength;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/5' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -73,7 +72,6 @@ Then check for the longest word by comparing the current word to the previous on
|
||||
}, 0);
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/6' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -144,7 +142,6 @@ For more information on `map` <a href='https://developer.mozilla.org/en/docs/Web
|
||||
}
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/7' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -49,7 +49,6 @@ title: Mutations
|
||||
return true;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/30' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -76,7 +75,6 @@ If they are _all_ found, the loop will finish without returning anything and we
|
||||
});
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/31' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -48,7 +48,6 @@ Make the variable created store the current value and append the word to it.
|
||||
return accumulatedStr;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/19' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -74,7 +73,6 @@ Make the variable created store the current value and append the word to it.
|
||||
}
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/21' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -87,6 +85,24 @@ Make the variable created store the current value and append the word to it.
|
||||
|
||||
* <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions#Recursion' target='_blank' rel='nofollow'>Functions - Recursion</a>
|
||||
|
||||
##  Advanced Code Solution:
|
||||
|
||||
function repeatStringNumTimes(str, num) {
|
||||
return num > 0 ? str.repeat(num) : '';
|
||||
}
|
||||
|
||||
repeatStringNumTimes("abc", 3);
|
||||
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
* This solution takes a declarative approach.
|
||||
* It is similar to the third solution, except it uses the ternary operator form of the `if` statement.
|
||||
|
||||
#### Relevant Links
|
||||
|
||||
* <a href='https://forum.freecodecamp.com/t/javascript-ternary-operator/15973' target='_blank' rel='nofollow'>JS Ternary</a>
|
||||
|
||||
##  NOTES FOR CONTRIBUTIONS:
|
||||
|
||||
*  **DO NOT** add solutions that are similar to any existing solutions. If you think it is **_similar but better_**, then try to merge (or replace) the existing similar solution.
|
||||
|
@@ -52,7 +52,6 @@ Pay close attention to the timing of the storing of variables when working with
|
||||
return results;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/734' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -80,7 +79,6 @@ Pay close attention to the timing of the storing of variables when working with
|
||||
});
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/733' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -103,7 +101,6 @@ Pay close attention to the timing of the storing of variables when working with
|
||||
return arr.map(Function.apply.bind(Math.max, null));
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/17' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -50,7 +50,6 @@ function frankenSplice(arr1, arr2, n) {
|
||||
return localArray;
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/repls/RedundantGrossGenres' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -74,7 +73,6 @@ function frankenSplice(arr1, arr2, n) {
|
||||
return localArr;
|
||||
}
|
||||
```
|
||||
 <a href='https://repl.it/repls/BelovedNegativeMoto' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
* Since our goal is to return the new array with out altering `arr1` or `arr2` we create a `localArr` and add all the items from `arr2` using the `slice()` function
|
||||
|
||||
|
@@ -56,7 +56,6 @@ We have to return a sentence with title case. This means that the first letter w
|
||||
return updatedTitle.join(' ');
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/8' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -83,7 +82,6 @@ Split the string by white spaces, and create a variable to track the updated tit
|
||||
|
||||
titleCase("I'm a little tea pot");
|
||||
|
||||
 <a href='https://repl.it/CLjU/9' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -99,7 +97,6 @@ We are making entire string lowercase and then converting it into array. Then we
|
||||
return str.toLowerCase().replace(/(^|\s)\S/g, (L) => L.toUpperCase());
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/14' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -40,7 +40,6 @@ You will need to use the slice() method and specify where to start and where to
|
||||
}
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/55' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
@@ -54,7 +53,6 @@ You will need to use the slice() method and specify where to start and where to
|
||||
return (str.length > num)?(str.slice(0,num)+"..."):str;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/54' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
### Code Explanation:
|
||||
|
||||
|
@@ -50,7 +50,6 @@ If there is no index for that number then you will have to deal with that case t
|
||||
return arr.length;
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/CLjU/36' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Code Explanation:
|
||||
|
||||
@@ -74,7 +73,6 @@ If there is no index for that number then you will have to deal with that case t
|
||||
|
||||
getIndexToIns([40, 60], 50);
|
||||
|
||||
 <a href='https://repl.it/CLjU/2547' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Code Explanation:
|
||||
|
||||
@@ -102,7 +100,6 @@ by [@HarinaPana](/u/harinapana)
|
||||
|
||||
getIndexToIns([40, 60], 50);
|
||||
|
||||
 <a href='https://repl.it/CLjU/4135' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Code Explanation:
|
||||
|
||||
@@ -120,7 +117,6 @@ by [@faustodc](/u/faustodc)
|
||||
return arr.indexOf(num);
|
||||
}
|
||||
|
||||
 <a href='https://repl.it/EB10/1' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Code Explanation:
|
||||
|
||||
@@ -148,7 +144,6 @@ by [@faustodc](/u/faustodc)
|
||||
|
||||
getIndexToIns([40, 60], 500);
|
||||
|
||||
 <a href='https://repl.it/CLjU/63' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Code Explanation:
|
||||
|
||||
@@ -174,7 +169,6 @@ by [@nivrith](/u/nivrith)
|
||||
|
||||
getIndexToIns([1,3,4],2);
|
||||
|
||||
 <a href='https://repl.it/IUJE/0' target='_blank' rel='nofollow'>Run Code</a>
|
||||
|
||||
## Code Explanation:
|
||||
|
||||
|
Reference in New Issue
Block a user