Skip to content

Commit eedb4ba

Browse files
committed
Improved formatting
2 parents 44987cc + f87e2c4 commit eedb4ba

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

labs/REPL.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ Properties using the array syntax:
128128
3
129129
```
130130

131-
Objects are compositional:
131+
Objects can be composed of other objects:
132+
132133

133134
```JavaScript
134135
> o.bar = [1, 2, 3, 4]
@@ -145,13 +146,13 @@ Objects are compositional:
145146

146147
## Functions
147148

148-
JavaScript functions are declared using the ```function``` keyword.
149+
1. JavaScript functions are declared using the ```function``` keyword.
149150

150151
```JavaScript
151152
var Foo = function () { }
152153
```
153154

154-
Functions that do not have a name are *Anonymous Functions*. These are commonly used as callback arguments to other functions.
155+
1. Functions that do not have a name are *Anonymous Functions*. These are commonly used as callback arguments to other functions.
155156

156157
```JavaScript
157158
//Anonymous function declaration
@@ -171,14 +172,14 @@ Foo(function () {
171172

172173
## Multi-line statements
173174

174-
The Node REPL allows for multi-line statements to be executed. When a line cannot be processed as a complete JavaScript statement the Node REPL prompts for more input:
175+
1. The Node REPL allows for multi-line statements to be executed. When a line cannot be processed as a complete JavaScript statement the Node REPL prompts for more input (this example starts a functional closure but does not terminate it with a closing bracket):
175176

176177
```
177178
> var boo = function () {
178179
...
179180
```
180181

181-
The ```...``` indicates that the Node REPL expects more input. ```CTRL+C``` can be used to terminate the multi-line statement. Now, define a multi-line function and execute it:
182+
1. The ```...``` indicates that the Node REPL expects more input. ```CTRL+C``` can be used to terminate the multi-line statement. Now, define a multi-line function and execute it:
182183

183184
```JavaScript
184185
> var boo = function () {
@@ -189,11 +190,11 @@ undefined
189190
'Hello World!'
190191
```
191192

192-
## Exiting
193+
## Exiting the REPL
193194

194195
Exiting the Node REPL can be done many ways including killing the process. However, the most common way is by pressing ```CTRL+C``` twice.
195196

196-
### Exiting programatically:
197+
### Exiting Node programatically:
197198

198199
```JavaScript
199200
process.exit()

0 commit comments

Comments
 (0)