This is usually not how JS works.

curMap = String(curMap);

would be more of the same "keep on trucking"