]> granicus.if.org Git - icinga2/blobdiff - doc/20-library-reference.md
Implement Dictionary#get and Array#get
[icinga2] / doc / 20-library-reference.md
index 6b78192d2f4e2156cfe20f044943bb449544ee9d..b3ed5b8ded3a485facdc751e04b98e541d068e4b 100644 (file)
@@ -554,6 +554,14 @@ Signature:
 Sets the element at the zero-based index to the specified value. The `index` must refer to an element
 which already exists in the array.
 
+### <a id="array-get"></a> Array#get
+
+Signature:
+
+    function get(index);
+
+Retrieves the element at the specified zero-based index.
+
 ### <a id="array-sort"></a> Array#sort
 
 Signature:
@@ -616,6 +624,15 @@ Signature:
 
 Creates or updates an item with the specified `key` and `value`.
 
+### <a id="dictionary-get"></a> Dictionary#get
+
+Signature:
+
+    function get(key);
+
+Retrieves the value for the specified `key`. Returns `null` if they `key` does not exist
+in the dictionary.
+
 ## <a id="scriptfunction-type"></a> Function type
 
 ### <a id="scriptfunction-call"></a> Function#call