DEV Community

Cover image for JavaScript Exercises
JJ
JJ

Posted on

JavaScript Exercises

Introduction

With Etch A Sketch done, I was glad to finally be able to move on. I honestly thought it might take me a full month to complete that project. Thankfully, I was done in just over a couple weeks and now I've moved on to learning about object oriented programming (OOP) concepts, as well as working through more JavaScript Exercises found here.

Calculator Exercises

The first set of functions that had to be made will tie into the final project in Foundations which is building a calculator. I had to create functions for adding, subtracting, multiplying, powers, and factorials. The first few were pretty simple, but factorials gave me a bit of a hard time. I spent about an hour trying to figure out how to manipulate the code to not decrement n while decrementing n-1. Once I figured that part out, it was quite simple to put together and I had a blast figuring it out.

Today I will be working on palindromes, and I have a pretty good idea of how to go about this one which seems easy enough just to reverse the string and store it in a new variable after stripping all whitespace and punctuation and then compare that to the original that is stripped of punctuation and whitespace.

If I get palindromes done fairly quickly, I'll get going on the Fibonacci sequence and try to implement that into code. I briefly looked at the Fibonacci sequence in my Discrete Mathematics class this past semester, but I don't really know the ins and outs of it in detail so, that one might give me a hard time. Once these exercises are done though, I'll be free to start the final project of Foundations before I move on to deciding which path to take.

Conclusion

As I get closer and closer to the end of the first part of The Odin Project, I'm thinking more and more about which end path to take. Ruby on Rails, or NodeJS. My first instinct was NodeJS from the get-go, but there are some interesting projects on the RoR side that I'm taking a liking to. I probably will stick with JavaScript and NodeJS because honestly, it seems like that would be a more useful stack for me given my market which I've never seen a job opening for RoR but have seen hundreds for JavaScript.

For now though, I'll focus back on the task at hand which is to solve these algorithms. The exercises are fun. I enjoy the test driven development as a means to check my work and see how I'm progressing, and whether my work is done or not. I hope each and every one of you are well and healthy. That's going to do it for this one, 'til next time...be good!

Photo by Markus Spiske: https://www.pexels.com/photo/black-laptop-computer-turned-on-showing-computer-codes-177598/

Top comments (2)

Collapse
 
xenobino profile image
Ahmed

Ahhh, someone who learns properly. Most of the beginners I see are in rush (for whatever reason). They want to learn x in y months and get $z in a bla bla bla.

You're doing well, don't let anybody tell you otherwise. Learn at the pace that suite you the most and enjoy the beauty of algorithms.

Collapse
 
warmastr profile image
JJ

Thanks Ahmed! I'm doing my best to no speed ahead and learn what I need to as I go. I do understand that this is one thing that cannot be rushed. Thanks for the read and reply :)