Declaring a Variable

This topic describes how to declare a variable.

To declare a variable

  • Use the var keyword.

For example:

var perfectNumber;

You can write code that saves a value in a variable when you declare it. For example:

var perfectNumber = 28;