Storing MapName in a variable instead of DisplayName

This, will store in variable 6 the Display Name:

$gameVariables.setVariable(6, $dataMap.displayName);

But if it is empty, it will return 0.
So, without the needing of compile ALL display names to ALL maps.
What's they to store in variable 6 the MAP NAME seen from the RMV Editor?
$gameVariables.setVariable(6, $dataMapInfos[$gameMap.mapId()].name)

Original thread: https://forums.rpgmakerweb.com/threads/storing-mapname-in-a-variable-instead-of-displayname.121052/