My Phase 1 Experience
Published: 2022-08-08 20:06:00


I've always had a rather interesting bond with coding. Whether it's seeing apps that teach it here and there, to taking a class in high school, to simply trying to study it... there was always some sort of barrier to my methods of study. 

The execution.

I never knew what to do <u>after</u> I learned everything. I would learn how to make something like:
`const a= 1;
const b= 2;
const c= a+b;
console.log(c);`
But my problem was indifference. I didn't see what I could do with that. Now, I can see the meaning behind it all.

## My Trials

Everybody has a thing or two that they have a problem with when they come to the field of coding. Whether it's knowing what to learn first, figuring out and trying to take in all the information at once, knowing the correct way to write the code itself, or even as simple as not knowing where to start.

My trials were quite similar to those listed above. I got over these hurdles once I got enrolled into Flatiron School. This introduced me to everything and everyone passionate about the very thing I strived to become: A software engineer.

## Forewarning for Greatness

I have learned quite a lot. The list is extensive. I am going to break this down.

When we first started at Flatiron, I was rather... intrigued. I was reading through the curriculum that was presented to me and I said to myself: 

> Wow, this is a lot. I like what I see.

Afterword, the rest is history. I have begun my first lessons into the curriculum.

## My Path

Let's start simple with variables. I already had quite an understanding of the point of variables once starting this course. I got that it stored stuff that could be used for other stuff. Very easy. Secondly, there was strings. It's just putting things in quotation marks to be used for values. Again; this was very easy. 

Now the fun happens.

I started learning about conditional statements. In other words; `if` statements. The purpose of these is to test whether something is true or false. If it's true do this, if it's not, do this instead. Additionally, you can compare more than one thing by using logical operators. These include `||`, `&&`, and `!`. Now these are very, _very_ useful. I have used these for most of the conditional statements that I had to write. In short, these are just the code's way of saying "OR", "AND", and "DOESN'T EQUAL"; or "NOT".
`  if (bill <= 100) {
    return 'This one is on me!';
  }
  else if (bill <= 150) {
    return 'Can we split this bill?';
}
  else {
    return 'On the count of three, we run!';
}
`
Last important skill that I learned before we get into the more advanced stuff is functions. These are the backbone of **everything** you do in JavaScript. The entire point of JavaScript is to allow for any sort of interactivity other than reading and clicking some buttons that don't do anything.

`function consoleMe(x){
console.log(x);
}`
This function; when called upon, will put whatever you put inside of the parenthesis and put it into the console. This thing:

![A picture of the console in your browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yav683a0wszm22jnn73i.png)


Now these are considered basic skills to me now. It was never like this before. Let's get into the more advanced stuff that I have been learning recently.

## My Challenges

I have dug into another type of function called an arrow function. These functions are so great and I am very happy they exist. These allow you to have something called '_implicit return_'. Now with all functions, you need a return. **Always**. Arrow functions allow you to do this all on one line. As displayed above, it took quite a few lines for just typing into the console and that didn't even have a return. Arrow functions are as simple as:
`const multiply = (x,y) => x*y;`
Arrow functions are superb to use with "Array Iteration". Essentially, Array iteration goes through everything in an array, gets what it is looking for, and modifies it in a way. There is a few built in methods for array iteration. The one I used the most is `.map()`, which keeps the original array in tact `&&`(and) attaching an `addEventListener` to a `fetch`. Event listeners are what the browser looks out for whenever you do anything. Click, move your mouse, scroll your mouse wheel, press a key; you name it. Secondly, 'fetch' allows you to retrieve something or give something to an API (Application Program Interface). In other words, an access point to a database. It allows you to get what you need from wherever you're getting it from. 

`fetch('http://localhost:3000/obj', {
            method: "GET",
            headers: {
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }
        })
        .then(res => res.json())
        .then(data => {
            data.map(names => {
// Whatever you want to do to each of the elements in your array.
}`

Finally, one of the most important things I have learned thus far would have to be JSON Server and postman. These two are a 'client-server' simulator. Postman sends the requests and JSON Server receives it. This is JSON Server in Ubuntu (terminal emulator):
![An image of JSON Server in Ubuntu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lq892hq40oq60ehog6oz.png)

All in all, I have thoroughly enjoyed my experience so far and I am happy to see my progress. I went from knowing about variables to knowing how to create an entire interactive website. I am excited to see what new skills and languages I have to learn in the near future. 

This is fun.