Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-11-27 02:13:23 +03:00
parent fd3aba0055
commit 8fe306b324

View File

@ -636,11 +636,14 @@ Compare to arrays ignoring element order and count.
Sort array as a different array.
```bnf
<array>.sortAs(<other>)
<array>.sortAs(<other>, 'tail')
<array>.sortAs(<other>, 'head')
-> <array>
```
Elements not present in `<other>` retain their relative order and are
placed after the sorted elements.
placed after the sorted elements if `'tail'` is passed as second argument
(default) and before them if `'tail'` is passed.
Example:
```javascript