I need assistance in removing double quotes from the string "Hello"
.
I have an array var ary = ['a', 'b' , 'c']
When I extract a value from the array, it returns the value in string format, such as ary[0] = "a"
, but I want it to be just a
.
I am working with a JSON file that looks like this:
{
"a":{
"name" : "Emma"
},
"b":{
"name" : "Harry"
},
"c":{
"name" : "Jonny"
}
}
I want to retrieve values from this JSON using the array, like ary[0].name = Emma
NOTE: I have tried using
str.replace(/\"/gi,""); && str.replace(/"/gi,"");
. If you have any other ideas on how to achieve this, please let me know as soon as possible.