I have something like this:
val = val.split(".");
//val[0] is name
//val[1] is John
I have to build object like this:
{name: "John"}
So I do:
filterArray = "'{'"+val[0]+"':'"+val[1]+"'}'";
var t = JSON.parse(filterArray);
And when I do console.log(filterArray);
I want to get: Object { name: "John" }
But can't do it the right why, please help :)