UNPKG

@arcgis/coding-components

Version:

Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.

1 lines • 647 kB
[{"id":"constants","title":"Constants","items":[{"type":"constant","name":"infinity","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#infinity","description":"Represents a value greater than any other number. `-Infinity` may also be used as a value smaller than any number.","examples":"\n**Example**\n\nCalculates the maximum of four field values\n\n```arcade\nvar values = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4 ];\nvar maxValue = -Infinity;\n\nfor(var i in values){\n maxValue = IIF(values[i] > maxValue, values[i], maxValue);\n}\n\nreturn maxValue;\n```\n\n","completion":{"label":"Infinity","detail":"Infinity","insertText":"Infinity","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nRepresents a value greater than any other number. `-Infinity` may also be used as a value smaller than any number."}}},{"type":"constant","name":"pi","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#pi","description":"The value of a circle's circumference divided by its diameter, approximately `3.14159`.","examples":"\n**Example**\n\nReturns the area of a circle feature\n\n```arcade\nvar r = $feature.radius;\nPI * r * r;\n```\n\n","completion":{"label":"PI","detail":"PI","insertText":"PI","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nThe value of a circle's circumference divided by its diameter, approximately `3.14159`."}}},{"type":"constant","name":"textformatting.backwardslash","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.backwardslash","description":"Inserts a backslash character `\\` into the text.","examples":"\n**Example**\n\nReturns '\\\\\\serverName\\foo\\bar'\n\n```arcade\nTextFormatting.BackwardSlash + TextFormatting.BackwardSlash + $feature.FILE_PATH\n```\n\n","completion":{"label":"TextFormatting.BackwardSlash","detail":"TextFormatting.BackwardSlash","insertText":"TextFormatting.BackwardSlash","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nInserts a backslash character `\\` into the text."}}},{"type":"constant","name":"textformatting.doublequote","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.doublequote","description":"Inserts a double quote character `\"` into the text.","examples":"\n**Example**\n\nReturns 'Nicholas \"Nick\" Anderson'\n\n```arcade\n$feature.NAME + \" \" + TextFormatting.DoubleQuote + $feature.ALIAS + TextFormatting.DoubleQuote + \" \" + $feature.SURNAME\n```\n\n","completion":{"label":"TextFormatting.DoubleQuote","detail":"TextFormatting.DoubleQuote","insertText":"TextFormatting.DoubleQuote","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nInserts a double quote character `\"` into the text."}}},{"type":"constant","name":"textformatting.forwardslash","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.forwardslash","description":"Inserts a forward slash character `/` into the text.","examples":"\n**Example**\n\nReturns '151/low'\n\n```arcade\n$feature.POP_DENSITY + TextFormatting.ForwardSlash + $feature.CLASS\n```\n\n","completion":{"label":"TextFormatting.ForwardSlash","detail":"TextFormatting.ForwardSlash","insertText":"TextFormatting.ForwardSlash","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nInserts a forward slash character `/` into the text."}}},{"type":"constant","name":"textformatting.newline","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.newline","description":"Inserts a new line, or line break, into the text. Multi-line labels are **NOT** supported in the ArcGIS API 3.x for JavaScript nor in the ArcGIS Online Map Viewer Classic.","examples":"\n**Example**\n\nReturns \"T2N \nR1W\"\n\n```arcade\n\"T\" + $feature.TOWNSHIP + TextFormatting.NewLine + \"R\" + $feature.RANGE\n```\n\n","completion":{"label":"TextFormatting.NewLine","detail":"TextFormatting.NewLine","insertText":"TextFormatting.NewLine","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nInserts a new line, or line break, into the text. Multi-line labels are **NOT** supported in the ArcGIS API 3.x for JavaScript nor in the ArcGIS Online Map Viewer Classic."}}},{"type":"constant","name":"textformatting.singlequote","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.singlequote","description":"Inserts a single quote character `'` into the text.","examples":"\n**Example**\n\nReturns \"Nicholas 'Nick' Anderson\"\n\n```arcade\n$feature.NAME + \" \" + TextFormatting.SingleQuote + $feature.ALIAS + TextFormatting.SingleQuote + \" \" + $feature.SURNAME\n```\n\n","completion":{"label":"TextFormatting.SingleQuote","detail":"TextFormatting.SingleQuote","insertText":"TextFormatting.SingleQuote","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nInserts a single quote character `'` into the text."}}}]},{"id":"array_functions","title":"Array functions","items":[{"type":"function","name":"all","bundle":"core","sinceVersion":"1.16","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#all","description":"Indicates whether all of the elements in a given array pass a test from the provided function. Returns `true` if the function returns `true` for all items in the input array.","examples":"\n**Examples**\n\nReturns `false` because some of the elements in the input array do not pass the `isEven` test\n\n```arcade\n// isEven is used to test if each element in the array is even\n// it returns true if the element is divisible by two, false if is not\nfunction isEven(value) { return value % 2 == 0 }\n// The isEven function will execute for each element in the array,\n// returning the following values: false, true, false, true, false\n// Since some of the values in the array did not pass the test\n// (return true), the return value will be false\nAll([1,2,3,4,5], isEven)\n```\n\nUses the existing `isEmpty` Arcade function as the `testFunction`. This is valid because `isEmpty` takes a single parameter and returns a boolean value. This expression returns `true` if all of the fields are empty.\n\n```arcade\nvar myArray = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4];\nAll(myArray, isEmpty)\n```\n\n","completion":{"label":"All","detail":"All(inputArray, testFunction) -> Boolean","insertText":"All(${1:inputArray_}, ${2:testFunction_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.16](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nIndicates whether all of the elements in a given array pass a test from the provided function. Returns `true` if the function returns `true` for all items in the input array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to test.\n- **testFunction**: [Function](https://developers.arcgis.com/arcade/guide/logic/#user-defined-functions) - The function used to test each element in the array `testFunction(value: Any) -> Boolean`. The function must return a truthy value if the element passes the test. The function can be a user-defined function or a core Arcade function defined with the following parameter:\n\n - **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - Represents the value of an element in the array.\n\n**Return value**: [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) \n`true` if the test function returns a truthy value for all the elements."}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"any","bundle":"core","sinceVersion":"1.16","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#any","description":"Tests whether any of the elements in a given array pass a test from the provided function. Returns `true` if the function returns `true` for at least one item in the input array.","examples":"\n**Examples**\n\nReturns `true` because at least one element in the input array passes the `isEven` test.\n\n```arcade\n// isEven is used to test if each element in the array is even\n// it returns true if the element is divisible by two, false if is not\nfunction isEven(value) { return value % 2 == 0 } \n// The isEven function will execute for each element in the array,\n// returning the following values: false, true, false, true, false\n// Since at least one value in the array passed the test\n// (return true), the return value will be true\nAny([1,2,3,4,5], isEven)\n```\n\nUses the existing `isEmpty` Arcade function as the `testFunction`. This is valid because `isEmpty` takes a single parameter and returns a boolean value. This expression returns `true` if any of the fields are empty.\n\n```arcade\nvar myArray = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4];\nAny(myArray, isEmpty)\n```\n\n","completion":{"label":"Any","detail":"Any(inputArray, testFunction) -> Boolean","insertText":"Any(${1:inputArray_}, ${2:testFunction_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.16](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nTests whether any of the elements in a given array pass a test from the provided function. Returns `true` if the function returns `true` for at least one item in the input array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to test.\n- **testFunction**: [Function](https://developers.arcgis.com/arcade/guide/logic/#user-defined-functions) - The function used to test each element in the array `testFunction(value: Any) -> Boolean`. The The function must return a truthy value if the element passes the test. The function can be a user-defined function or a core Arcade function defined with the following parameter:\n\n - **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - Represents the value of an element in the array.\n\n**Return value**: [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) \n`true` if the test function returns a truthy value for any of the elements."}},"parametersInfo":{"min":2,"max":2}},[{"type":"function","name":"array","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#array1","description":"Returns a new array of a given length.","examples":"\n**Examples**\n\nReturns `[null, null, null, null, null]`.\n\n```arcade\nArray(5)\n```\n\nReturns `[\"hello\",\"hello\"]`\n\n```arcade\nArray(2, \"hello\")\n```\n\nReturns `[1,1,1]`.\n\n```arcade\nArray(3, 1)\n```\n\n","completion":{"label":"Array","detail":"Array(arrayLength, defaultValue?) -> Array<Any>","insertText":"Array(${1:arrayLength_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns a new array of a given length.\n\n**Parameters**\n\n- **arrayLength**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - The desired length for the new array.\n- **defaultValue** (_Optional_): [Any](https://developers.arcgis.com/arcade/guide/types/#any) - The value for each element in the array. If no value is specified, the default will be `null`.\n\n**Return value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt;"}},"parametersInfo":{"min":1,"max":2}},{"type":"function","name":"array","bundle":"core","sinceVersion":"1.23","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#array2","description":"Returns either a shallow or deep copy of an input array.","examples":"\n**Examples**\n\nCreates a shallow copy of the input array\n\n```arcade\nvar person1 = {\n firstName: \"Jane\",\n lastName: \"Doe\"\n};\nvar person2 = {\n firstName: \"John\",\n lastName: \"Smith\"\n};\nvar people = [ person1, person2 ];\n// create a shallow copy of the array\nvar copiedArray = Array(people);\npeople[0] == copiedArray[0];\n// returns true\n// this is a shallow copy of the array, so the elements share the same references\n```\n\nCreates a deep copy of the input array\n\n```arcade\nvar deepCopy = Array(people, true);\npeople[0] == deepCopy[0]\n// returns false\n// this is a deep copy of the array, so the elements do NOT share the same references\n```\n\n","completion":{"label":"Array","detail":"Array(inputArray, deep?) -> Array<Any>","insertText":"Array(${1:inputArray_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.23](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns either a shallow or deep copy of an input array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to be copied.\n- **deep** (_Optional_): [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) - When `true`, creates a deep copy of each element in the input array, meaning elements in the output array will not share the same references as the elements of the input array. Default value is `false`.\n\n**Return value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt;"}},"parametersInfo":{"min":1,"max":2}}],{"type":"function","name":"back","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#back","description":"Returns the last element of an array. If the input array is empty, then the expression evaluation will fail.","examples":"\n**Example**\n\nReturns `'gray'`.\n\n```arcade\nvar colors = ['orange', 'purple', 'gray']\nBack(colors)\n```\n\n","completion":{"label":"Back","detail":"Back(inputArray) -> Any","insertText":"Back(${1:inputArray_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns the last element of an array. If the input array is empty, then the expression evaluation will fail.\n\n**Parameter**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to get the last value from.\n\n**Return value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any)"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"count","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#count","description":"Returns the number of items in an array.","examples":"\n**Example**\n\nReturns 6\n\n```arcade\nCount([12,21,32,44,58,63])\n```\n\n","completion":{"label":"Count","detail":"Count(value) -> Number","insertText":"Count(${1:value_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns the number of items in an array.\n\n**Parameter**\n\n- **value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - An array on which to perform the operation.\n\n**Return value**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)"}},"parametersInfo":{"min":1,"max":1}},[{"type":"function","name":"defaultvalue","bundle":"core","sinceVersion":"1.26","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#defaultvalue1","description":"Returns a specified default value if an index in an array does not exist or the value at the specified index is `null` or an empty text value.","examples":"\n**Examples**\n\nArray with value at the given index\n\n```arcade\nvar a = [23,4,null,36,901]\nDefaultValue(a, 4, \"No data\");\n// returns 901\n```\n\nArray with no value at the given index\n\n```arcade\nvar a = [23,4,null,36,901]\nDefaultValue(a, 5, \"No data\");\n// returns \"No data\"\n```\n\nArray with a null value at the given index\n\n```arcade\nvar a = [23,4,null,36,901]\nDefaultValue(a, 2, \"No data\");\n// returns \"No data\"\n```\n\n","completion":{"label":"DefaultValue","detail":"DefaultValue(inputArray, index, defaultValue) -> Any","insertText":"DefaultValue(${1:inputArray_}, ${2:index_}, ${3:defaultValue_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.26](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns a specified default value if an index in an array does not exist or the value at the specified index is `null` or an empty text value.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to check.\n- **index**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - The index to check.\n- **defaultValue**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - This value is returned if the index does not exist or the value at the specified index is `null` or an empty text value.\n\n**Return value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) \nReturns the value at the specified index if defined. Otherwise, returns the value specified in `defaultValue`."}},"parametersInfo":{"min":3,"max":3}},{"type":"function","name":"defaultvalue","bundle":"core","sinceVersion":"1.26","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#defaultvalue2","description":"Checks whether an index nested several levels deep in a multidimensional array has a value and returns that value if present. Otherwise, this function returns a specified default value if at least one of the nested keys or indices does not exist or the value at the specified key or index is `null` or an empty text value. This allows you to drill into a nested structure in one step rather than check values within each array.","examples":"\n**Examples**\n\nArray with a value at the nested index\n\n```arcade\nvar a = [23,4,[0,0,1,1,0],36,901]\nDefaultValue(a, [2, 3], \"No data\");\n// returns 1\n```\n\nArray with no value at the nested index\n\n```arcade\nvar a = [23,4,[0,0,1,1,0],36,901]\nDefaultValue(a, [2, 10], \"No data\");\n// returns \"No data\"\n```\n\nArray with no value at the parent index\n\n```arcade\nvar a = [23,4,[0,0,1,1,0],36,901]\nDefaultValue(a, [10, 3], \"No data\");\n// returns \"No data\"\n```\n\nArray of dictionaries with nested values\n\n```arcade\nvar data = {\n time: Date(2024, 0, 24, 12),\n interval: 1,\n intervalUnit: \"days\",\n weather: {\n precipitation: {\n type: \"rain\",\n values: [0.4, 0, 0, null, 0.1, 0.8, 1],\n unit: \"inches\"\n },\n temperature: {\n values: [50, 50, 51, 52, 55, 49, 51],\n unit: \"f\"\n },\n }\n}\n\nvar a = [ data, data2, data3 ]\nDefaultValue(a, [0, \"weather\",\"precipitation\",\"values\", 6], \"No data\");\n// returns 1\n```\n\n","completion":{"label":"DefaultValue","detail":"DefaultValue(inputArray, keys, defaultValue) -> Any","insertText":"DefaultValue(${1:inputArray_}, ${2:keys_}, ${3:defaultValue_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.26](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nChecks whether an index nested several levels deep in a multidimensional array has a value and returns that value if present. Otherwise, this function returns a specified default value if at least one of the nested keys or indices does not exist or the value at the specified key or index is `null` or an empty text value. This allows you to drill into a nested structure in one step rather than check values within each array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to check.\n- **keys**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Number](https://developers.arcgis.com/arcade/guide/types/#number) \\| [Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - An array of the keys or indexes to check in each level of the container's structure.\n- **defaultValue**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - This value is returned if at least one of the keys or indices does not exist or the value at the specified key is `null` or an empty text value.\n\n**Return value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) \nReturns the value at the specified key or index if defined. Otherwise, returns the value specified in `defaultValue`."}},"parametersInfo":{"min":3,"max":3}}],[{"type":"function","name":"distinct","bundle":"core","sinceVersion":"1.1","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#distinct1","description":"Returns a set of distinct, or unique, values for an array of values.","examples":"\n**Example**\n\n```arcade\nDistinct([1,1,2,1,1,2,2,3,4,5])\n// Returns [1,2,3,4,5]\n```\n\n","completion":{"label":"Distinct","detail":"Distinct(values) -> Array<Any>","insertText":"Distinct(${1:values_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.1](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns a set of distinct, or unique, values for an array of values.\n\n**Parameter**\n\n- **values**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - An array of values on which to perform the operation.\n\n**Return value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt;"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"distinct","bundle":"core","sinceVersion":"1.1","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#distinct2","description":"Returns a set of distinct, or unique, values for a list of values.","examples":"\n**Example**\n\n```arcade\nDistinct('high','medium','low',0,'high','high','low')\n// Returns ['high','medium','low',0]\n```\n\n","completion":{"label":"Distinct","detail":"Distinct([value1, ..., valueN]?) -> Array<Any>","insertText":"Distinct($0)","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.1](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns a set of distinct, or unique, values for a list of values.\n\n**Parameter**\n\n- **[value1, ..., valueN]** (_Optional_): [Any](https://developers.arcgis.com/arcade/guide/types/#any) - A list of values on which to perform the operation.\n\n**Return value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt;"}},"parametersInfo":{"min":0,"max":-1}}],{"type":"function","name":"erase","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#erase","description":"Removes a value from an array at a given index. Existing elements positioned at or above the given index will shift down one index value. The array decreases in size by one.","examples":"\n**Examples**\n\n```arcade\nvar colors = ['orange', 'purple', 'gray']\nErase(colors, 1)\n// colors = ['orange','gray']\n```\n\n```arcade\nvar colors = ['orange', 'purple', 'gray']\nErase(colors, -1)\n// colors = ['orange','purple']\n```\n\n","completion":{"label":"Erase","detail":"Erase(inputArray, index) -> Null","insertText":"Erase(${1:inputArray_}, ${2:index_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nRemoves a value from an array at a given index. Existing elements positioned at or above the given index will shift down one index value. The array decreases in size by one.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to remove the value from.\n- **index**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - The index of the value to remove from the array. If a negative index is provided, it will be used as an offset from the end of the array.\n\n**Return value**: Null"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"filter","bundle":"core","sinceVersion":"1.16","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#filter","description":"Creates a new array with the elements filtered from the input array that pass a test from the provided function.","examples":"\n**Examples**\n\nReturns a new array comprised of elements that passed the `isEven` filter.\n\n```arcade\nfunction isEven(i) { return i % 2 == 0 } \nFilter([1,2,3,4,5], isEven) // Returns [2,4]\n// Since 2 and 4 are even, they are the only values\n// included in the output array.\n```\n\nUses the existing `isEmpty` Arcade function in the `filterFunction`. Returns a new array of fields that are not empty.\n\n```arcade\nvar myArray = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4];\n\nfunction isNotEmpty(value){\n return !isEmpty(value);\n}\nFilter(myArray, isNotEmpty)\n// Returns only values that are defined,\n// excluding empty values from the result\n```\n\n","completion":{"label":"Filter","detail":"Filter(inputArray, filterFunction) -> Array<Any>","insertText":"Filter(${1:inputArray_}, ${2:filterFunction_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.16](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nCreates a new array with the elements filtered from the input array that pass a test from the provided function.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to filter.\n- **filterFunction**: [Function](https://developers.arcgis.com/arcade/guide/logic/#user-defined-functions) - The function used to filter elements in the array `filterFunction(value: Any) -> Boolean`. The function must return a truthy value if the element passes the test. This function can be a user-defined function or a core Arcade function defined with the following parameter:\n\n - **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - Represents the value of an element in the array.\n\n**Return value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; \nReturns an array with the elements that passe the test function."}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"first","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#first","description":"Returns the first element in an array. Returns `null` if the array is empty.","examples":"\n**Example**\n\nprints 'orange'\n\n```arcade\nFirst(['orange', 'purple', 'gray'])\n```\n\n","completion":{"label":"First","detail":"First(inputArray) -> Any","insertText":"First(${1:inputArray_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns the first element in an array. Returns `null` if the array is empty.\n\n**Parameter**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array from which to return the first item.\n\n**Return value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any)"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"front","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#front","description":"Returns the first element of an array. If the input array is empty, then the expression evaluation will fail.","examples":"\n**Example**\n\nReturns `'orange'`.\n\n```arcade\nvar colors = ['orange', 'purple', 'gray']\nFront(colors)\n```\n\n","completion":{"label":"Front","detail":"Front(inputArray) -> Any","insertText":"Front(${1:inputArray_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns the first element of an array. If the input array is empty, then the expression evaluation will fail.\n\n**Parameter**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array from which to get the first value.\n\n**Return value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any)"}},"parametersInfo":{"min":1,"max":1}},[{"type":"function","name":"hasvalue","bundle":"core","sinceVersion":"1.26","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#hasvalue1","description":"Indicates whether an array has a value at the given index.","examples":"\n**Examples**\n\nArray with value at the given index\n\n```arcade\nvar a = [23,4,null,36,901]\nHasValue(a, 4);\n// returns true\n```\n\nArray with no value at the given index\n\n```arcade\nvar a = [23,4,null,36,901]\nHasValue(a, 5);\n// returns false\n```\n\nArray with a null value at the given index\n\n```arcade\nvar a = [23,4,null,36,901]\nHasValue(a, 2);\n// returns false\n```\n\n","completion":{"label":"HasValue","detail":"HasValue(inputArray, index) -> Boolean","insertText":"HasValue(${1:inputArray_}, ${2:index_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.26](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nIndicates whether an array has a value at the given index.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to check.\n- **index**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - The index to check.\n\n**Return value**: [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"hasvalue","bundle":"core","sinceVersion":"1.26","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#hasvalue2","description":"Checks whether an index nested several levels deep in a multidimensional array has a value. This allows you to drill into a nested structure in one step rather than check values within each array. Returns `true` if the indexes at each level of the structure exist and include a non-null value.","examples":"\n**Examples**\n\nArray with a value at the nested index\n\n```arcade\nvar a = [23,4,[0,0,1,1,0],36,901]\nHasValue(a, [2, 4]);\n// returns true\n```\n\nArray with no value at the nested index\n\n```arcade\nvar a = [23,4,[0,0,1,1,0],36,901]\nHasValue(a, [2, 10]);\n// returns false\n```\n\nArray with no value at the parent index\n\n```arcade\nvar a = [23,4,[0,0,1,1,0],36,901]\nHasValue(a, [10, 5]);\n// returns false\n```\n\nArray of dictionaries with nested values\n\n```arcade\nvar data = {\n time: Date(2024, 0, 24, 12),\n interval: 1,\n intervalUnit: \"days\",\n weather: {\n precipitation: {\n type: \"rain\",\n values: [0.4, 0, 0, null, 0.1, 0.8, 1],\n unit: \"inches\"\n },\n temperature: {\n values: [50, 50, 51, 52, 55, 49, 51],\n unit: \"f\"\n },\n }\n}\n\nvar a = [ data, data2, data3 ]\nif(HasValue(a, [0, \"weather\",\"precipitation\",\"values\", 6])){\n // This check succeeds so the value will be returned\n return a[0].weather.precipitation.values[6];\n // returns 1\n}\n```\n\n","completion":{"label":"HasValue","detail":"HasValue(inputArray, indexes) -> Boolean","insertText":"HasValue(${1:inputArray_}, ${2:indexes_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.26](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nChecks whether an index nested several levels deep in a multidimensional array has a value. This allows you to drill into a nested structure in one step rather than check values within each array. Returns `true` if the indexes at each level of the structure exist and include a non-null value.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to check.\n- **indexes**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Number](https://developers.arcgis.com/arcade/guide/types/#number) \\| [Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - An array of the keys or indexes to check in each level of the structure.\n\n**Return value**: [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean)"}},"parametersInfo":{"min":2,"max":2}}],{"type":"function","name":"includes","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#includes","description":"Determines whether an array contains a given value. Returns `true` if the value is found within the array.","examples":"\n**Examples**\n\nReturns `true`.\n\n```arcade\nIncludes(['orange', 'purple', 'gray'], 'purple')\n```\n\nReturns `false`.\n\n```arcade\nIncludes(['orange', 'purple', 'gray'], 'red')\n```\n\n","completion":{"label":"Includes","detail":"Includes(inputArray, value) -> Boolean","insertText":"Includes(${1:inputArray_}, ${2:value_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nDetermines whether an array contains a given value. Returns `true` if the value is found within the array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array.\n- **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - The value to look for in the given array.\n\n**Return value**: [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"indexof","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#indexof","description":"Returns the zero-based index location of the input item in an array. If `item` does not exist, then `-1` is returned.","examples":"\n**Example**\n\nprints 2\n\n```arcade\nvar num = [1,2,3,4];\nreturn indexof(num, 3);\n```\n\n","completion":{"label":"IndexOf","detail":"IndexOf(inputArray, item) -> Number","insertText":"IndexOf(${1:inputArray_}, ${2:item_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nReturns the zero-based index location of the input item in an array. If `item` does not exist, then `-1` is returned.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to search.\n- **item**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - The item to locate in the array.\n\n**Return value**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"insert","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#insert","description":"Inserts a new value into an array at a given index. Existing elements positioned at or above the given index will shift up one index value. The array increases in size by one.","examples":"\n**Examples**\n\n```arcade\nvar colors = ['orange', 'purple', 'gray']\nInsert(colors, 1, 'yellow')\n// colors = ['orange','yellow','purple','gray']\n```\n\n```arcade\nvar colors = ['orange', 'purple', 'gray']\nInsert(colors, -1, 'yellow')\n// colors = ['orange','purple','yellow','gray']\n```\n\n","completion":{"label":"Insert","detail":"Insert(inputArray, index, value) -> Null","insertText":"Insert(${1:inputArray_}, ${2:index_}, ${3:value_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nInserts a new value into an array at a given index. Existing elements positioned at or above the given index will shift up one index value. The array increases in size by one.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to insert the new value into.\n- **index**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - The index of the array where the new value should be inserted. An index of 0 will insert the value at the beginning of the array. An index that equals the size of the array will insert the value at the end of the array. An index greater than the size of the array will cause an error. If a negative index is provided, it will be used as an offset from the end of the array.\n- **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - The value to insert into the array.\n\n**Return value**: Null"}},"parametersInfo":{"min":3,"max":3}},{"type":"function","name":"map","bundle":"core","sinceVersion":"1.16","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#map","description":"Creates a new array based on results of calling a provided function on each element in the input array.","examples":"\n**Examples**\n\nConverts all of the elements in the array from Fahrenheit to Celsius and returns them in a new array.\n\n```arcade\n// This function will take in values from the input array and convert them to Celsius\nfunction toCelsius(f) {\n return Round((f - 32) * 5/9, 2)\n}\n// The toCelsius function executes for each each item\n// in the input array.\n// Map returns the resulting array of converted values.\nMap([82, 67, 96, 55, 34], toCelsius)\n// returns [27.78, 19.44, 35.56, 12.78, 1.11]\n```\n\nConverts date objects to formatted text\n\n```arcade\nvar dates = [ Date(1996, 11, 10), Date(1995, 1, 6), Date(1992, 2, 27), Date(1990, 10, 2)];\nfunction formatDates(dateVal) { return Text(dateVal, 'MMM D, Y') }\nMap(dates, formatDates);\n// returns ['Dec 10, 1996', 'Feb 6, 1995', 'Mar 27, 1992', 'Nov 2, 1990']\n```\n\n","completion":{"label":"Map","detail":"Map(inputArray, mappingFunction) -> Array<Any>","insertText":"Map(${1:inputArray_}, ${2:mappingFunction_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.16](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nCreates a new array based on results of calling a provided function on each element in the input array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to map.\n- **mappingFunction**: [Function](https://developers.arcgis.com/arcade/guide/logic/#user-defined-functions) - The function to call on each element in the array `mappingFunction(value: Any) -> Any`. The function must return a new item that will be part of the returned array. The function can be a user-defined function or a core Arcade function defined with the following parameter:\n\n - **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - Represents the value of an element in the array.\n\n**Return value**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; \nThe items returned by the mapping function."}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"none","bundle":"core","sinceVersion":"1.16","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#none","description":"Tests whether none of the elements in a given array pass a test from the provided function. Returns `true` if the `testFunction` returns `false` for all items in the input array.","examples":"\n**Examples**\n\nReturns `false` because some of the elements in the input array pass the `isEven` test\n\n```arcade\n// isEven is used to test if each element in the array is even\n// it returns true if the element is divisible by two, false if is not\nfunction isEven(value) { return value % 2 == 0 } \n// The isEven function will execute for each element in the array,\n// returning the following values: false, true, false, true, false\n// Since at least one value in the array passed the test\n// (return true), the return value will be false\nNone([1,2,3,4,5], isEven)\n```\n\nUses the existing `isEmpty` Arcade function as the `testFunction`. This is valid because `isEmpty` takes a single parameter and returns a boolean value. This expression returns `true` if none of the fields are empty.\n\n```arcade\nvar myArray = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4];\nNone(myArray, isEmpty)\n```\n\n","completion":{"label":"None","detail":"None(inputArray, testFunction) -> Boolean","insertText":"None(${1:inputArray_}, ${2:testFunction_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.16](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nTests whether none of the elements in a given array pass a test from the provided function. Returns `true` if the `testFunction` returns `false` for all items in the input array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array to test.\n- **testFunction**: [Function](https://developers.arcgis.com/arcade/guide/logic/#user-defined-functions) - The function to test each element in the array `testFunction(value: Any) -> Boolean`. The function must return a falsy value if the element doesn't pass the test. The function can be a user-defined function or a core Arcade function defined with the following parameter:\n\n - **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - Represents the value of an element in the array.\n\n**Return value**: [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) \n`true` if all the elements in the array don't pass the test function."}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"pop","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#pop","description":"Removes and returns the element at the end of the array. If the array is empty, then an error is thrown.","examples":"\n**Example**\n\nReturns 'gray'. The input array will now equal `['orange', 'purple']`.\n\n```arcade\nPop(['orange', 'purple', 'gray'])\n```\n\n","completion":{"label":"Pop","detail":"Pop(inputArray) -> Any","insertText":"Pop(${1:inputArray_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nRemoves and returns the element at the end of the array. If the array is empty, then an error is thrown.\n\n**Parameter**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The input array from which the last element will be removed and returned.\n\n**Return value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any)"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"push","bundle":"core","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#push","description":"Adds an element to the end of an array and returns the new length of the array.","examples":"\n**Example**\n\nReturns 4. The input array will now equal `['orange', 'purple', 'gray', 'red']`.\n\n```arcade\nPush(['orange', 'purple', 'gray'], 'red')\n```\n\n","completion":{"label":"Push","detail":"Push(inputArray, value) -> Number","insertText":"Push(${1:inputArray_}, ${2:value_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nAdds an element to the end of an array and returns the new length of the array.\n\n**Parameters**\n\n- **inputArray**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Any](https://developers.arcgis.com/arcade/guide/types/#any)&gt; - The array to have elements pushed to.\n- **value**: [Any](https://developers.arcgis.com/arcade/guide/types/#any) - The value to add as the last element of the input array.\n\n**Return value**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"reduce","bundle":"core","sinceVersion":"1.16","link":"https://developers.arcgis.com/arcade/function-reference/array_functions/#reduce","description":"Executes a provided \"reducer\" function on each element in the array, passing in the return value from the calculation of the previous element.","examples":"\n**Examples**\n\nWithout the `initialValue` parameter, the first two elements of the `cities` array are passed into the add function as arguments.\n\n```arcade\nvar cities = [{\n name: 'Columbus',\n pop: 913921\n}, {\n name: 'Cincinnati',\n pop: 307266\n}, {\n name: 'Dayton',\n pop: 140343\n}, {\n name: 'Cleveland',\n pop: 376599\n}];\n// the first time this function is called it will take the first two elements of the array as x and y\n// The subsequent times the function is executed, it will take the return value\n// from the previous function call as x and the next array value as y\nfunction mostPopulated(city1, city2) {\n IIf (city1.pop > city2.pop, city1, city2)\n}\nvar largestCity = Reduce(cities, mostPopulated)\nConsole(largestCity.name + ' is the biggest city in the list with a population of ' + largestCity.pop)\n// Columbus is the biggest city in the list with a population of 913921\n```\n\nSince the `initialValue` parameter is set, that value will be the function's first argument (`city1`), and the first element of the `cities` will be the function's second argument (`city2`).\n\n```arcade\nvar los_angeles = { name: 'Los Angeles', pop: 3898747 }\n// since an initialValue is provided, it will be passed into the maxPop function as x\n// and the first value of the array will be passed in as y for the initial function call\n// The subsequent times the function is executed, it will take the return value\n// from the previous function call as x and the next array value as y\nvar largestCity = Reduce(cities, mostPopulated, los_angeles)\nConsole(largestCity.name + ' is the biggest city in the list with a population of ' + largestCity.pop)\n// Los Angeles is the biggest city in the list with a population of 3898747\n```\n\n","completion":{"label":"Reduce","detail":"Reduce(inputArray, reducerFunction, initialValue?) -> Any","insertText":"Reduce(${1:inputArray_}, ${2:reducerFunction_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[Since version 1.16](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\nExecutes a provided \"reducer\" function on each element in the array, passing in the return value from the calculation of the previous eleme