Which way is it safe to delete elements of a Map?

//Does a Map need to go through a Map loop to delete elements?

//Does the Map need to use Map’s key to delete elements?

1 Like

Just use the remove node :slight_smile:

1 Like

Is the following Map deleted correctly?

If you want to clear a map, use

image

There’s hardly ever any point in using loops on maps. The whole idea of maps is you don’t need loops.

The for each loop uses indexes to access the elements. This being said you should not modify the array while looping through it. So the deletion in the picture below is wrong?

It’s not an array, it’s a map, so you can remove any element in any order :slight_smile: