Deleting all of the elements in a Dictionary does not delete the dictionary itself. In the context of an Array, you can use Array.remove_at(index) to remove the element in the Array at the specified index. In other contexts, setting the dictionary to null should be sufficient.
If the intention is to remove a dictionary from an array only when the dictionary is empty, this will require you to write some handling code to do so.
func delete_dict_key_or_dict_if_empty(array:Array, index:int, key:String)
array[index].erase(key)
if array[index].is_empty():
array.remove_at(index)
The above was written as example only. Your particular use-case might require different implementation.