I have a usecase where I am building a js object dynamically with keys (strings) coming from outside source. How should I process the strings before using them as keys in the js object?
var strings = ["a1","2", "\@ja"]; // coming from outside source. They could be anything
var obj = {};
for(let key of strings){
// what should do here to make sure the key string is safe to use as key
obj[key] = "random value";
}