O'Reilly logo

JavaScript: Novice to Ninja, 2nd Edition by Darren Jones

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

Chapter 2: Programming Basics

In the last chapter, we introduced JavaScript, then set up a programming environment. We even got our hands dirty with a few JavaScript programs. In this chapter, we’ll delve further and learn how JavaScript works, as well as write some more programs.

This chapter will cover the following topics:

  • The importance of well-commented code

  • JavaScript grammar ― expressions, statements, semicolons and whitespace

  • Primitive data types

  • Strings ― string literals, string properties and methods

  • Declaring and assigning constants and variables

  • Numbers ― decimal, hexadecimal, octal, binary and exponent form, Infinity, and NaN

  • Arithmetic operations such as +, -, *, /, and %

  • Undefined and null

  • Booleans ― truthy and falsy ...

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