O'Reilly logo

JavaScript: Novice to Ninja by Darren Darren Jones 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 2Programming Basics

In the last chapter, we introduced JavaScript and set up a programming environment where we got our hands dirty with a few JavaScript programs. In this chapter, we’re going to delve further to learn how JavaScript works, and start writing some programs.

We’ll cover the following topics:

  • the importance of well-commented code

  • JavaScript grammar―expressions, statements, semicolons, and whitespace

  • primitive data types

  • strings―string literals and string methods such as length

  • variables―declaring and assigning

  • numbers―decimal, hexadecimal, octal and exponent form, Infinity, and NaN

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

  • undefined and null

  • Booleans―truthy and falsy values

  • logical operators―AND, OR, and ...

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