As soon as I started learning Ruby, a few years ago, I got immediately hooked on its Range class. I could not believe I had been programming in .NET without them for so long. I like to think of range objects as the specification for a for loop, packaged in an object that can be passed around. That's...
This post is part of a series called the Guided Tours . In this second installment we are still looking inside the jQuery code. Trust me, even if it's hard to digest, you can still learn enough if you focus on a little bit at a time. The code we are interested in today is the following. //from jQuery...
This post is part of a series called the Guided Tours . I'm sure I'm not alone when I say that one of the best ways to improve our coding skills is by reading code written by someone else. Sometimes we don't realize how lucky we are to have so much source code at our fingertips, namely Open...
This post is part of a series called JavaScript Demystified . This particular chapter is further divided in two parts. Read Part 1 . Build your own hierarchy Let's pretend we are building some scripts that deal with musical instruments. We could define our own Guitar class type like this: //The constructor...
This post is part of a series called JavaScript Demystified . This particular chapter is further divided in two parts. Read Part 2 . In a previous installment in this series we saw how we could create constructor functions in JavaScript. Back then I just mentioned that we don't have classes in JavaScript...