O'Reilly logo

JavaScript Absolute Beginner’s Guide by Kirupa Chinnathambi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Commenting Your Code

In This Chapter

Learn the importance of code comments

Familiarize yourself with the JavaScript syntax for writing comments

Understand good commenting practices

We are almost done with our break. Just one more topic left, and it is a good one! See, here is the thing—everything you write in your code editor might seem like it is intended for your browser’s eyes only:

var xPos = -500;function boringComputerStuff() {  xPos += 5;  if (xPos > 1000) {    xPos = -500;  }  requestAnimationFrame(boringComputerStuff);}

As you will soon find out, that isn’t the case. There is another audience for your code. That audience is made up of human beings.

Your code is often used or scrutinized by other ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required