I'm having weird problems with datamaps updateCloropleth function. I followed this example :
https://github.com/markmarkoh/datamaps/releases/tag/v0.2.2
Here is an example of my problem. When I do this:
map.updateChoropleth({
    "AFG": colorx
});
The color updates. However, when I do this:
var countryx = "AFG";
map.updateChoropleth({
    countryx: colorx
});
It doesn't work.
I've checked that countryx == "AFG" returns true, so it's definitely the same value. The variable colorx can be passed fine, but passing the variable countryx as a key seems to break the function.
Any ideas how or why this is happening?
 
     
    