Arrays and objects - NathanNeelis/functional-programming GitHub Wiki

Recap

During blok Tech I already started learning how to manipulate arrays and objects.
But since then, I have to admit that I haven't been practicing.
That's why at the start of this course I started recapping these skills on FreeCodeCamp.

My notes

.pop() // removes element from end of array
.shift() // removes element from start of array
.push() // adds element at the end of an array
.unshift() // adds element at the start of an array

.splice() // Removes one or more items from an array first parameter represents the index of an array and the second the number of elements to delete. Splice can return an array of removed elements. The third parameter adds elements to the array.

.slice() // Copies any number of items while leaving the original array untouched. First parameter is the start of the slicing in the array. The second is to stop the extraction. Important to know is that is up to but not including the end number.

...ArrayName // Copies an array. You can copy it for example into another array.

indexOf() // Search for an element in an array. It returns the position in the array. If the item is not in the array it returns -1.

Still need to learn more

I noticed during these exercises I still have difficulty with for loops. In this instance that would be the "for .. in" loop.
But I also need to recap myself on the "for each" and the "for of" loop.