Delete redundant solution (#36393)

The first advanced solution is almost identical to the intermediate one. Per "similar but better" rule, I believe the first one should be kept (or at the bare minimum, they should at least fill the same category).
This commit is contained in:
Nilys
2019-07-08 02:05:02 +02:00
committed by Randell Dawson
parent d3701fc9a0
commit f75e20a969

View File

@ -96,23 +96,6 @@ Explain solution here and add any relevant links
* <a href='https://devdocs.io/javascript/global_objects/array/includes' target='_blank' rel='nofollow'>Array.prototype.includes (Devdocs)</a>
## ![:rotating_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/rotating_light.png?v=3 ":rotating_light:") Advanced Code Solution (Declarative Solution):
function diffArray(arr1, arr2) {
return arr1
.filter(el => !arr2.includes(el))
.concat(
arr2.filter(el => !arr1.includes(el))
)
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
### Code Explanation:
Explain solution here and add any relevant links
## ![:rotating_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/rotating_light.png?v=3 ":rotating_light:") Advanced Code Solution Alternative (Declarative Solution):
function diffArray(arr1, arr2) {
return [
...diff(arr1, arr2),