Skip to content

Commit

Permalink
Update normative-conventions.md
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Gibbons <[email protected]>
  • Loading branch information
michaelficarra and bakkot committed Aug 2, 2024
1 parent 572fe10 commit 58222fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion normative-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Any time an iterable or async-iterable value (a value that has a `Symbol.iterato

Although primitive Strings are default iterable (`String.prototype` has a `Symbol.iterator` method which enumerates code points), it is now considered a mistake to iterate a String without specifying whether the String is providing an abstraction over code units, code points, grapheme clusters, or something else.

NB: This convention is new as of 2024, and most earlier parts of the language do not follow it. In particular, positional destructuring (both binding and assignment), array spread, object spread, argument spread, for-of loops, `yield *`, the `Set` and `AggregateError` constructors, `Object.groupBy`, `Map.groupBy`, `Promise.all`, `Promise.allSettled`, `Promise.any`, `Promise.race`, `Array.from`, the static `from` methods on typed array constructors, and `Iterator.from` (Stage 3 at time of writing) all accept primitives where iterables are expected.
NB: This convention is new as of 2024, and most earlier parts of the language do not follow it. In particular, positional destructuring (both binding and assignment), array spread, argument spread, for-of loops, `yield *`, the `Set` and `AggregateError` constructors, `Object.groupBy`, `Map.groupBy`, `Promise.all`, `Promise.allSettled`, `Promise.any`, `Promise.race`, `Array.from`, the static `from` methods on typed array constructors, and `Iterator.from` (Stage 3 at time of writing) all accept primitives where iterables are expected.

0 comments on commit 58222fb

Please sign in to comment.