File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ saveCityZipCode(city, zipCode);
113
113
```
114
114
** [ ⬆ back to top] ( #table-of-contents ) **
115
115
116
- ### Avoid Mental Mapping
116
+ ### Avoid Mental Mappingf
117
117
Explicit is better than implicit.
118
118
119
119
** Bad:**
@@ -343,6 +343,14 @@ function parseBetterJSAlternative(code) {
343
343
344
344
** Good:**
345
345
``` javascript
346
+ function parseBetterJSAlternative (code ) {
347
+ const tokens = tokenize (code);
348
+ const ast = lexer (tokens);
349
+ ast .forEach ((node ) => {
350
+ // parse...
351
+ });
352
+ }
353
+
346
354
function tokenize (code ) {
347
355
const REGEXES = [
348
356
// ...
@@ -367,14 +375,6 @@ function lexer(tokens) {
367
375
368
376
return ast;
369
377
}
370
-
371
- function parseBetterJSAlternative (code ) {
372
- const tokens = tokenize (code);
373
- const ast = lexer (tokens);
374
- ast .forEach ((node ) => {
375
- // parse...
376
- });
377
- }
378
378
```
379
379
** [ ⬆ back to top] ( #table-of-contents ) **
380
380
You can’t perform that action at this time.
0 commit comments