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. :smile:

//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

  1. Introduction to the Basic Data Structure Challenges
  • PassedUse an Array to Store a Collection of Data
  • PassedAccess an Array’s Contents Using Bracket Notation
  • PassedAdd Items to an Array with push() and unshift()
  • PassedRemove Items from an Array with pop() and shift()
  • PassedRemove Items Using splice() HAll in GitHub and rep.it here: Rep.it GitHub
Written on July 27, 2018