Category Archives: Javascript

Learning JS Properly – Week 2

Week two was just announced, and here are the assignments for the week!

  1. Read chapters 3, 4, and 5 of JavaScript: The Definitive Guide OR chapters 3 and 4 and the preface of Professional JavaScript for Web Developers.
  2. Work through sections 2 – 5 of the JavaScript track on Codecademy.
  3. Solve either Project Euler Problem 1 or Problem 2. Feel free to solve both.
  4. To prepare for Week 3, read the blog post JS Objects in Detail. If you want to work ahead, this is the general roadmap I’m using to make these assignments.

Don’t forget: You should be typing out lots of example code in the console or in JSFiddle. You’re not going to learn nearly as much if you don’t actually type it out with your own fingers.

I’ve been using jsFiddle as my IDE for working through the problems, and one thing I really like about it is that I can practice my HTML and CSS as well! It’s helping me to figure out exactly how they work together with Javascript and how to manipulate the DOM.

In this post, mr_noah is posting his answer to the Project Euler practice problems and he uses the following code to output his sum to the document body:

$("body").append("<p>runningTotal = "+runningTotal+"</p>");

I tried to do the same, but it didn’t seem to work. I then realized he had imported a JQuery library. I wanted to use pure JS, so I went to trusty Google and found a solution that worked without using JQuery:

var para=document.createElement('p');
var node=document.createTextNode('Sum = ' +sum);
para.appendChild(node);
document.body.appendChild(para)
console.log(document.body);</span>

It feels really good to see everything coming together! I used some of the CSS that I learned from Codecademy just to dress up my output page a bit. See my solutions to the Project Euler Problem 1 and Problem 2.

I’ll post the full Week 2 review review once I finish up the rest of the assignments. Cheers!

Learning JS Properly – Study Group Index

Edit: Thanks for stopping by visitors from the Reddit study group! I’ve moved my blog on over to my own domain over at codingisbananas.com. Come visit me over there for all new posts!


Here’s a compilation of all of the links for the course which I’m using to keep organized. I’ll keep it updated as the weeks progress.

Announcement and Index on Reddit:

Assignment Posts:

Week 2 Discussions: [CURRENT]

Week 0 Discussions:

Week 1 Discussions:

Learning JS Properly – Week 1 Review

Week 1 of the Javascript Study Group has come to an end, and I have to say that I’ve really been good about working on the assignments and I’m really excited to keep going!

Here’s a list of the first week’s assignments again:

  1. If you don’t know HTML/CSS pretty well, do the Web Fundamentals track on Codecademy.
  2. Read the Preface and Chapters 1 and 2 of JavaScript: The Definitive Guide OR read the Introduction and Chapters 1 and 2 of Professional JavaScript for Web Developers.
  3. Work through section 1 of the JS Track on Codecademy.
  4. Make a least one comment in this thread about something you learned, found interesting, or didn’t understand very well.

My Progress:

  1. This is the assignment that has probably taken up the most time for me. It’s not the difficulty of it, its just that there are a lot of exercises. I still have about a third of the way to go but I will definitely finish this up this week.
  2. I chose to read Professional JavaScript for Web Developers and I found the reading to be quite interesting. While I’ve had exposure to the programming of Javascript, I haven’t really had much exposure to how Javascript works with together with HTML and the DOM and BOM. Chapter 2 really helped me to connect the dots with all of this.One specific thing I got out of this was that you sometimes don’t want your Javascript to load before the page begins rendering because the wait time results in a perceived slowness to your page. This can be accomplished by adding a defer or async attribute to your <script> tag or including the JS in the <body>. Each behaves its own way.
  3. This last assignment was pretty simple as I’ve completed the Javascript Original Track already. I did have fun with the last exercise though. Below is the code I wrote. It prompts the user to enter a number and only displays the string required to pass the lesson when their entry number is divisible by both 3 and 5.

var finish = "I finished my first course!";

function fizzBuzz(num){
    if(num%3 === 0){
        if(num%5 === 0){
            return 'fizzbuzz';
        } else {
            return 'fizz';
        }
    }else if(num%5 === 0){
        return 'buzz';
    }else
        return 'not fizzin or buzzin';
}

var input = "";
do {
    input = prompt("Gimme some fizzbuzz.(fizz is a multiple of 3, buzz is a multiple of 5)",'write here');
    console.log(fizzBuzz(input));
    if(fizzBuzz(input)==="fizzbuzz"){
        console.log(finish);
        break;
    }
}while (true);

There were a few questions that people asked on the subreddit and I commented on a few of them. Here is an index of all posts related to the study group. So far many of the questions were regarding Eloquent Javascript, which can be very dense at times. I think as we move forward and the assignments start to get more difficult, the discussions will become more involved.

That’s it for now! Looking forward to starting on Week 2!!!

Learning JS Properly

Looks like I’m going to begin another course! …well, study group actually.

A good friend of mine, who’s been a professional coder for a few years, suggested that I make sure I completely learn Javascript if I am to seriously consider breaking in to the world of Web Development. He gave me a link to a 6-8 week JS study roadmap, which I coincidentally had already found. There is a study group that just started on Monday at /r/learnjavascript that I’m going to take an active role in.

I’m really excited to get to work and really bolster my knowledge! I think having a bit of structure and knowing that other people are going to be doing this with me is both encouraging and motivating. I hope to be able to collaborate with people and get help while also helping others throughout the remainder of the course. Below is what I’ll have to do for week 1. I’ll be back when I’m done to make some comments on the assignments.

FIRST WEEK ASSIGNMENTS:

  1. If you don’t know HTML/CSS pretty well, do the Web Fundamentals track on Codecademy.
  2. Read the Preface and Chapters 1 and 2 of JavaScript: The Definitive Guide OR read the Introduction and Chapters 1 and 2 of Professional JavaScript for Web Developers.
  3. Work through section 1 of the JS Track on Codecademy.
  4. Make a least one comment in this thread about something you learned, found interesting, or didn’t understand very well.

Cheers!