So I am following this blog, Introducing Data Expressions in ArcGIS Dashboards, to learn Arcade for use in Dashboards.
Can someone please explain these two pieces of codes line by line?
// Empty dictionary to capture each hazard reported as separate rows.
var choicesDict = {'fields': [{ 'name': 'split_choices', 'type': 'esriFieldTypeString'}],
'geometryType': '', 'features': []}; // Need help understanding the syntax
var index = 0;
// Split comma separated hazard types and store in dictionary.
for (var feature in fs) {
var split_array = Split(feature["Report_road_condition"], ',')
var count_arr = Count(split_array)
for(var i = 0; i < count_arr; i++ ){
choicesDict.features[index++] = {
'attributes': { 'split_choices': Trim(split_array[i]), // Don't know what this line is doing
}}
}}