Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 787 Bytes

File metadata and controls

34 lines (20 loc) · 787 Bytes
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 5 column 18
---

# VARIABLES

A variable is a reference to a value. Define a variable using the `var` keyword.

Here's an example:

```js
var example;
```

The above variable is **declared**, but it isn't defined.

Here's an example of defining a variable, making it reference a specific value:

```js
var example = 'some string';
```

Note that it starts with the `var` keyword and uses the equals sign between the variable name and the value that it references.

Create a file named `variables.js`.

In that file create a variable named `example`.

**Make the `example` variable reference the value `some string`.**

Then use `console.log()` to print the `example` variable to the console.

Check to see if your program is correct by running this command:

`javascripting verify variables.js`
---