You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: problems/variables/problem.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,29 +2,29 @@
2
2
3
3
# VARIABLES
4
4
5
-
A variable is a reference to a value. Define a variable using the `var` keyword.
5
+
A variable is a name that can reference a specific value. Variables are declared using `var` followed by the variable's name.
6
6
7
7
Here's an example:
8
8
9
9
```js
10
10
var example;
11
11
```
12
12
13
-
The above variable is **declared**, but it isn't defined.
13
+
The above variable is **declared**, but it isn't defined (it does not yet reference a specific value).
14
14
15
15
Here's an example of defining a variable, making it reference a specific value:
16
16
17
17
```js
18
18
var example = 'some string';
19
19
```
20
20
21
-
Note that it starts with the `var` keyword and uses the equals sign between the variable name and the value that it references.
21
+
Note that it is **declared** using `var` and uses the equals sign to **define** the value that it references. This is colloquially known as "Making a variable equal a value".
22
22
23
23
Create a file named `variables.js`.
24
24
25
-
In that file create a variable named `example`.
25
+
In that file declare a variable named `example`.
26
26
27
-
**Make the `example` variable reference the value `some string`.**
27
+
**Make the variable `example` equal to the value `'some string'`.**
28
28
29
29
Then use `console.log()` to print the `example` variable to the console.
0 commit comments