- <emu-alg><ol><li>Let <var>group</var> be <emu-const>empty</emu-const>.</li><li>For each <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> { [[Key]], [[Elements]] } <var>g</var> of <var>groups</var>, do<ol><li>If ! <emu-xref aoid="SameValueZero" id="_ref_17"><a href="https://tc39.es/ecma262/#sec-samevaluezero">SameValueZero</a></emu-xref>(<var>g</var>.[[Key]], <var>key</var>) is <emu-val>true</emu-val>, then<ol><li>Set <var>group</var> to <var>g</var>.</li></ol></li></ol></li><li>If <var>group</var> is <emu-const>empty</emu-const>, then<ol><li>Let <var>elements</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Set <var>group</var> to the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Record</a></emu-xref> { [[Key]]: <var>key</var>, [[Elements]]: <var>elements</var> }.</li><li>Append <var>group</var> as the last element of <var>groups</var>.</li></ol></li><li>Append <var>value</var> as the last element of <var>group</var>.[[Elements]].</li></ol></emu-alg>
0 commit comments