public Sub mapToArray(m As Map) As Object()
Dim arr(m.Size * 2) As Object 'array size is double of the map because both keys and values are elements
Dim i As Int=0
Dim value As Object
For Each key As Object In m.Keys
value=m.Get(key)
LogColor($"key=${key}, value=${value}"$, Colors.blue)
arr(i)=key
i = i +1
arr(i)=value
i =i +1
Next
Return arr
End Sub