Jorge Romero
Total beginner here 😁 just trying to write about what I learn in order to get a better grasp of concepts and hopefully influence or teach someone something new.
If you see anything wrong please comment and I will gladly correct. I appreciate you. Thank you
One of the most fascinating things I have learned through my JavaScript journey is how to shift the way you think about these programming constructs.
It is true that objects and arrays are different and serve different purposes. Yet, there is a sense in which they are the same thing.
For example, you can use
Array.map(f)to apply a functionfto every element of the array and return the resulting array. But you can also define a similarmap()for any data structure that could reasonably be iterated through.It turns out that it often is very desirable to do this shift in thinking, given the current hype with functional programming (which I really like) :)