Day 3 of 100 Days Of Code
Day 3: July 27, Friday
Today’s Progress: I’ve gone through the first few exercises on FreeCodeCamp Basic Data Structures.
Thoughts I thought this was going to be easy, but yeah I over thought a couple of the challenges and spent a few hours trying to fix the spaghetti code monster I created pretty tricky there FCC.
//Remove Items from an Array with pop() and shift()
function popShift(arr) {
let popped = arr.pop(); // change this line (This was tricky I was over thinking it)
let shifted = arr.shift(); // change this line
return [shifted, popped];
}
// do not change code below this line
console.log(popShift(['challenge', 'is', 'not', 'complete']));
Link(s) to work
Written on July 27, 2018