Data Types

How Computing Works

🙋 Need help? Ask an expert now!

Computers are machines that process data. Data is stored in the computer memory as variables. Variables have name, data type, and value. This fundamental idea of a variable is used in almost every programming language, including java. The syntax for JavaScript variables is shown below:

let variable_name = variable_value;

The sample code above shows an example how you can declare a variable and prints in on the console. The second line creates a variable called count and assigns the integer value 5 to the variable. The third line prints count on the console using console.log(). This is the simplest and most common way of creating a variable in JavaScript.

Edit Me on GitHub!

Application Question

Which of the following statements is a valid variable declaration?