Add list reverse · whatwg/infra@7f8c8ee
jakearchibal
·
2026-04-10
·
via Recent Commits to infra:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1675,6 +1675,10 @@ a new <a>ordered set</a> |clone|, so that <a for=set>replacing</a> "<code>a</cod
|
1675 | 1675 | "<code>foo</code>" in |clone| gives « "<code>foo</code>", "<code>b</code>", "<code>c</code>" », |
1676 | 1676 | while |original|[0] is still the <a>string</a> "<code>a</code>". |
1677 | 1677 | |
| 1678 | +<p>To <dfn export for=list,stack,queue,set>reverse</dfn> a <a>list</a> |list| is to create a new |
| 1679 | +<a>list</a> |reversed|, of the same designation, and, <a for=list>for each</a> |item| of |list|, |
| 1680 | +<a for=list>prepend</a> |item| to |reversed|. |
| 1681 | + |
1678 | 1682 | <p>To <dfn export for=list,stack,queue,set lt="sort in ascending order|sorting in ascending order|sort|sorting">sort in ascending order</dfn> |
1679 | 1683 | a <a>list</a> |list|, with a less than algorithm |lessThanAlgo|, is to create a new <a>list</a> |
1680 | 1684 | |sorted|, containing the same <a for=list>items</a> as |list| but sorted so that according to |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。