Day 16 of 100 Days Of Code
Day 16: August 09, Thursday
Today ‘s Progress: I continue to work Functional Programming Challenges.
Thoughts: Some of the FCC_Challenges were pretty hard others very simple, I am hanging in there.
//Combine Two Arrays Using the concat Method
//Use the concat method in the nonMutatingConcat function to concatenate attach to the end of original. The function should return the concatenated array.
function nonMutatingConcat(original, attach) {
// Add your code below this line
console.log((original), (attach));
console.log(" Now CONCAT!!!");
let myArr= first.concat(attach);
console.log(myArr);
return myArr;
// Add your code above this line
}
var first = [1, 2, 3];
var second = [4, 5];
nonMutatingConcat(first, second);
//[Array.prototype.concat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)
console.log("-------------------Next------------------------");
This one took a few google searched and trying to figure out concat
… Array.prototype.concat()
Link(s) to work
Introduction to the Functional Programming Challenges
- PassedRemove Elements from an Array Using slice Instead of splice
- PassedCombine Two Arrays Using the concat Method
- PassedAdd Elements to the End of an Array Using concat Instead of push
- PassedUse the reduce Method to Analyze Data
- PassedSort an Array Alphabetically using the sort Method
All code is in GitHub and repl.it here: repl.it FuncProg or GitHub FuncProg
Written on August 9, 2018