Skip to content

Commit

Permalink
enumerate positions where primitives are iterated
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra authored Aug 2, 2024
1 parent a73fa06 commit 572fe10
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.
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.

0 comments on commit 572fe10

Please sign in to comment.