summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2013-05-06 13:46:16 +0100
committerStephen Dolan <mu@netsoc.tcd.ie>2013-05-06 13:46:54 +0100
commit48be23233ad63bf1bd218c259efedff3e52106c5 (patch)
treef79c3b52124b916fedb30f204732440dee8ef79c /docs
parent88a6dc5343a66b2db3ad36f0fa9f24fc89282caa (diff)
Add the "has" function. Closes #74.
Diffstat (limited to 'docs')
-rw-r--r--docs/content/3.manual/manual.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index 6f80b78b..7b490659 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -453,6 +453,25 @@ sections:
input: '[42,3,35]'
output: ['[0,1,2]']
+ - title: `has`
+ body: |
+
+ The builtin function `has` returns whether the input object
+ has the given key, or the input array has an element at the
+ given index.
+
+ `has($key)` has the same effect as checking whether `$key`
+ is a member of the array returned by `keys`, although `has`
+ will be faster.
+
+ examples:
+ - program: 'map(has("foo"))'
+ input: '[{"foo": 42}, {}]'
+ output: ['[true, false]']
+ - program: 'map(has(2))'
+ input: '[[0,1], ["a","b","c"]]'
+ output: ['[false, true]']
+
- title: `select`
body: |