Skip to content

Commit f8b335b

Browse files
Format code-blocks in arrays concept so ... (#1085)
* Format code-blocks in arrays concept so they look nicer on the site. * Format the code
1 parent 64f7d9c commit f8b335b

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"[markdown]": {
3+
"editor.wordWrap": "on",
4+
"editor.rulers": [
5+
// This is the cut-off on the website for most code blocks if they are
6+
// displayed to a user. The rulers at 80 and 120 make less sense here
7+
// because of how whitespace is (not) rendered.
8+
65
9+
]
10+
}
11+
}

concepts/arrays/about.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ names[1];
1414
Arrays can also be created using the constructor syntax, but for most uses, the array literal syntax is recommended.
1515

1616
```javascript
17-
const names = new Array()
18-
names.push('Jack', 'Laura', 'Paul', 'Megan')
17+
const names = new Array();
18+
names.push('Jack', 'Laura', 'Paul', 'Megan');
1919

2020
names[1];
2121
// => Laura
@@ -30,22 +30,24 @@ const names = ['Jack', 'Laura', 'Paul', 'Megan'];
3030
names.length;
3131
// => 3
3232

33-
// Properties can be set on arrays using bracket ['property'] or dot .property
34-
// notation, and this will affect the length, as shown below.
33+
// Properties can be set on arrays using bracket ['property'] or
34+
// dot .property notation, and this will affect the length, as
35+
// shown below.
3536

3637
names.magician = 'Elyse';
3738
names.length;
3839
// => 4
3940

40-
// The property shows up when logging the array, making it seem that the
41-
// property is somehow incorporated in the array.
41+
// The property shows up when logging the array, making it seem
42+
// that the property is somehow incorporated in the array.
4243

4344
names;
4445
// => ["Jack", "Laura", "Paul", "Megan", magician: "Elyse"]
4546

46-
// However, be aware. Properties added via non-numeric keys are NOT part of the
47-
// array's internal list, and are not traversed or mutated when using one of
48-
// the traversal or mutation operations.
47+
// However, be aware. Properties added via non-numeric keys are
48+
// NOT part of the array's internal list, and are not traversed
49+
// or mutated when using one of the traversal or mutation
50+
// operations.
4951

5052
names.forEach((name) => console.log(name));
5153
// => Jack

0 commit comments

Comments
 (0)