Using a JavaScript constant in Data Map

Is there an issue using constants / objects in the Data Map? I have a simple script that works the first time, but if I open it again or step through the data model, I get a “constant redeclaration” error. The “LANG” field has the two-character code used as keys for the object.

const objLang = 
{ 
  "SP": "Spanish",
  "EN": "English",
  "RU": "Russian"
}

var result = "English";
result = objLang[record.fields.LANG];

result;

The DataMapper’s JavaScript is not yet fully ES6-compliant, so the const keyword is not interpreted correctly. Use var instead.