Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
rename flatten to flat
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed May 22, 2018
1 parent 0cc56eb commit 093eacc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions proposal.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<pre class=metadata>
title: Array.prototype.flatMap &amp; Array.prototype.flatten
title: Array.prototype.flatMap &amp; Array.prototype.flat
toc: false
stage: 3
contributors: Michael Ficarra and Brian Terlson
</pre>

<emu-intro id="intro">
<h1>Introduction</h1>
<p>`Array.prototype.flatten` returns a new array with all sub-array elements concatted into it recursively up to the specified depth.</p>
<p>`Array.prototype.flat` returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.</p>
<p>`Array.prototype.flatMap` first maps each element using a mapping function, then flattens the result into a new array. It is identical to a map followed by a flatten of depth 1, but flatMap is quite often useful and merging both into one method is slightly more efficient.</p>
</emu-intro>

Expand All @@ -24,9 +24,9 @@ <h1>Array.prototype.flatMap ( _mapperFunction_ [ , _thisArg_ ] )</h1>
1. Return _A_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-Array.prototype.flatten">
<h1>Array.prototype.flatten( [ _depth_ ] )</h1>
<p>When the `flatten` method is called with zero or one arguments, the following steps are taken:</p>
<emu-clause id="sec-Array.prototype.flat">
<h1>Array.prototype.flat( [ _depth_ ] )</h1>
<p>When the `flat` method is called with zero or one arguments, the following steps are taken:</p>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _sourceLen_ be ? ToLength(? Get(_O_, `"length"`)).
Expand Down

1 comment on commit 093eacc

@mathiasbynens
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update gh-pages accordingly? Thanks.

Please sign in to comment.