High Order Functions

I had a goal before I started the immerse program to take good care of my health by eating right and working out regularly.

Did you know? This past Sunday was “take care of yourself” day. On this day, I was not doing what the day called for. I realized that into my second week and I’ve already failed to meet my personal goals to take good care of myself. Instead, I was underwater trying to finish my weekend homework. In fact, I was engrossed in this project the entire weekend. I think I was putting a lot of pressure on myself to complete it before the Sunday midnight deadline.

I spent the weekend pushing my brain to learn High Order Functions (HOFs). Among the HOFs, I mainly used filter and map functions to sort through an object with an array with, even more objects and arrays. Exactly the reason why we need filters and map functions: to get straight to what you’re looking for from a big file of data.

Here is a break down of the two functions:

var items = [X] 
filter, [X] => [x] gives back an array of fewer items based on a condition
map, [X] => [newX] gives back an array the same size where changes have been made to the items

These definitions are also relevant to my life goals. Now that I’m in week three, there is still time to map out my current life and filter out unnecessary pressure. After filtering out the junk, I need to map out a renewed clear mindset to keep myself healthy, both mentally and physically for the remaining 10 weeks.