Skip to content

Commit a0f8e23

Browse files
authored
Merge pull request nzakas#362 from ronen-e/patch-1
Fix typo - use correct name reference
2 parents 1fade41 + 4845409 commit a0f8e23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manuscript/06-Symbols.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,10 @@ let collection = {
308308
let messages = [ "Hi" ].concat(collection);
309309

310310
console.log(messages.length); // 3
311-
console.log(messages); // ["hi","Hello","world"]
311+
console.log(messages); // ["Hi","Hello","world"]
312312
```
313313

314-
The `collection` object in this example is set up to look like an array: it has a `length` property and two numeric keys. The `Symbol.isConcatSpreadable` property is set to `true` to indicate that the property values should be added as individual items to an array. When `collection` is passed to the `concat()` method, the resulting array has `"Hello"` and `"world"` as separate items after the `"hi"` element.
314+
The `collection` object in this example is set up to look like an array: it has a `length` property and two numeric keys. The `Symbol.isConcatSpreadable` property is set to `true` to indicate that the property values should be added as individual items to an array. When `collection` is passed to the `concat()` method, the resulting array has `"Hello"` and `"world"` as separate items after the `"Hi"` element.
315315

316316
I> You can also set `Symbol.isConcatSpreadable` to `false` on array subclasses to prevent items from being separated by `concat()` calls. Subclassing is discussed in Chapter 8.
317317

0 commit comments

Comments
 (0)