freeCodeCamp
Reflection


Basic Algorithm Scripting

Exercises


The advanced coding lessons were very challenging. Compared to the normal lessons, the lack of instruction and guidance made it difficult to solve. I did think it was a great activity to do because it forced me to apply what I had learned previously and come up with a way to solve a real problem. The exercises took me over an hour each, and when I finally solved them it was a great relief.


Overall, the exercises proved to be very challenging and frustrating. After figuring them out, I realized that I can do this, and that I have a better knowledge of JavaScript than I previously thought.


My Account


screenshot of freeCodeCamp exercises

Click the button below to view my freeCodeCamp Account

Click Me

Reverse a String


The first exercise I tried was "Reverse a String". This exercise looking back on it is pretty easy. When I first started on it and opened it up I did not think that however. As I began thinking through ways to solve it I immediately knew I should somehow split the word, reverse it, and then join the letters back together. The actual application of this method proved to be a challenge. I tried to add all sorts of things to the code like variable sequences, which did not work. Eventually I had to look at some hints, and figured out the correct placement for the code I wanted to use.

Close

Factorialize a Number


The second exercise I did was "Factorialize a Number". This time I knew what to expect, or so I thought. I opened it up and read the basic explanation of how 5! = 120. I already had come up with a plan in my head and started typing out code. I typed the statement: return num * num-4 *num-3, etc. This worked, but only if num = 5. This puzzled me for quite some time as I tried to think of ways to make this a statement that I could type out. After 30 minutes or so I remembered loops. If I could call a variable and loop a specific set of code. Once I decided to use a “for” statement I struggled to use it. Once again I had to go through a couple hints before I solved the problem. Once again I figured out what I wanted to do but couldn’t place it correctly.

Close

Find the Longest Word in a String


The third exercise I wanted to do was "Check for Palindromes". This exercise was very hard, and after several hours I decided to switch exercises. I ended up working on "Find the Longest Word in a String". I immediately typed up steps that I needed to follow and wrote code to split the string inot an array of words. At this point when I tested the code it returned a count of the number of words, and not the number of letters in one word. I went to the next step though, and sorted the array to have the longest word first. From there it was a matter of figuring out how to count the length of the first item in the array. Overall this exercise was the easiest for me to figure out, though it did take a while to solve.

Close