JavaScript30 - 4 Array Cardio Day 1
Tags: javascript, beginners, javascript30, learning
Published: 2024-06-04 15:36:31

Let me just start by saying my initial thoughts about this challenge were completely wrong.  I figured this would be the easiest challenge BY FAR and was expecting to complete it and write this post in the same day.  Here I am, almost two weeks later having just finished watching Wes Bos's video with his solutions.

He was absolutely right calling this Array Cardio because it was a workout for sure.  Plus it reminded me, not so gently, how little I know about arrays, how they work and what you can do with their sweet sweet information.

```js
    const oldPeople = inventors.filter(function (person){
      if (person.year < 1600) {
        return person.year > 1500;
      }
    } )
    console.log(oldPeople)
```

I guess we should basically start at the top and take it from there...This challenge obviously had us working with arrays from start to finish in many ways I never knew possible.  It covered different tasks that started with filtering names from a given list to sorting different street names from a Wikipedia page in real time.  

```js
  const fifteen = inventors.filter(inventor => (inventor.year >= 1500 && inventor.year < 1600));

    console.table(fifteen);
```

The exercises covered four different ways to manipulate data within an array, those being: filter, sort, map and reduce.  There were 8 exercises in total and I mostly struggled with number 6 which had you go to [this link right here](https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris) and work solely in the console to take the information off the page, turn it from a node into an array and then list out the necessary information.  I missed the fact that the data in the array was pretty obviously an object and eventually moved on without finding a perfect solution on my own/with the help of google.

Despite being stumped on one question I did manage to solve the other 7 exercises on my own.  Very few of my solutions matched Wes's but that's part of the fun!  I would probably have been a bit letdown if I saw that I came up with the exact same answer, as by the time I completed this challenge I now had two different ways to complete each task.

![The console.table is a complete gamechanger!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy11bm9yc4uzi9en384y.png)

I do have to give a HUGE shoutout to one part of this challenge in particular.  This was when Wes introduced the console.table() command.  I knew console.log() was a huge tool in coding but never knew there were more variations to the console commands.  Looking back at it now it's pretty obvious that there would be different ways to show information in the console but it never occurred to me that they could be so different and helpful.  I definitely want to do a quick dive into different console commands just to see what else I can do, as this simple change from .log to .table completely blew my mind!

This challenge was a toughie and I am exhausted.  I spent days upon days working on this.  I should start leaving my expectations at the door when I think about coding and how the rest of this course will be because I couldn't have been more wrong by assuming this would be quick and painless.  I am excited to work on something a bit more tangible with the next challenge: Flex Panels Image Gallery!  I'll see you then!

![the next lesson!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/260iuiaga4ijit6928ew.png)