I have a object
let x = { "propName": "response" }
Is there a way we can change the key name for the object. I would like to pass an index for the propName like
{ "prop1Name": "response" }
Is there a way to do this, I know I cant do it like this but, I tried it with
var obj = { "prop"+i+"Name": "response" };
console.log(obj);
But, it failed ofcourse. Is there a way to do it?