I have an object:
"locales": {
"en":["au", "uk"],
"de":["ch", "de"]
}
I check if a language is in this object then create the object with just the found language.
var language = 'en';
if(language in locales){
locales = { language : locales[language]};
...
But logging locales gives:
{ language: [ 'au', 'uk' ] }
Where I would expect to see:
{ en: [ 'au', 'uk' ] }
The new object is using a string rather than var for the object key - how can I fix this?
