Quotes & Key Ideas:
splicemethod is used to remove elements from an array. It takes two arguments: the first is the index of where to start removing items and the second is the number of items to remove (if the second isn't provided, then default is to remove items to the end). NOTE:
splicemutates the original array
concatmethod is used to join items end to end. For arrays, it will not mutate the original arrays but return a new array with the combined items.
- "Functional programming is all about creating and using non-mutating functions."
concatdoes not mutate the original array while
pushdoes. This means if we want to add elements to an array without mutating it
concatis a better choice
I only made it a through a few challenges today, but I'm happy I made a little bit of progress especially considering it was my first day back at work after being sick. Today's challenges weren't too difficult. I had seen some of these methods in previous challenges, but in a different context. I'm enjoying being able to see the different use cases - I think it's helping me gain a better understanding of them.
Link to work:
You can read my full journal for #100DaysOfCode on GitHub