CHAPTER 2

Programming

CHAPTER CONTENTS

2.1 Learning to Program

2.2 Getting Started

2.2.1 The Browser Address Box

2.2.2 Runner Pages

2.2.3 Interactive Shells

2.2.4 Files

2.3 Elements of Programs

2.3.1 Expressions

2.3.2 Variables

2.3.3 Statements

2.4 The Practice of Programming

2.4.1 Comments

2.4.2 Coding Conventions

2.4.3 Code Quality Tools

2.5 The JavaScript Programming Language

Chapter Summary

Exercises

Introduction

People write programs for a variety of tasks, such as to play music and videos, to organize personal data, and to find answers to questions that would take too long to work out with pencil and paper. Programming can reward you with feelings of accomplishment (from producing something useful) and power (from watching your commands ...

Get Programming with JavaScript: Algorithms and Applications for Desktop and Mobile Browsers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.