Add a unique function.

This commit is contained in:
Stephen Dolan committed 2012-12-03 02:02:12 +00:00
1 parent c8bbfed041
commit fadeb66365
3 files changed
+17

No files matched your search

+12
View File
@@ -542,6 +542,18 @@ sections:
input: '[{"foo":1, "bar":10}, {"foo":3, "bar":100}, {"foo":1, "bar":1}]'
output: ['[[{"foo":1, "bar":10}, {"foo":1, "bar":1}], [{"foo":3, "bar":100}]]']
- title: `unique`
body: |
The `unique` function takes as input an array and produces
an array of the same elements, in sorted order, with
duplicates removed.
examples:
- program: 'unique'
input: '[1,2,5,3,5,3,1,3]'
output: ['[1,2,3,5]']
- title: `contains`
body: |