Lalit Rawat Lalit Rawat - 8 days ago 7
AngularJS Question

How to remove double quotes from JSON Array

var json = [
"{"AccountType":"CurrentLiability","AccountCode":"880","Name":"Owner A Drawings"}",
"{"AccountType":"CurrentLiability","AccountCode":"881","Name":"Owner A Funds Introduced"}",
"{"AccountType":"TermLiability","AccountCode":"900","Name":"Loan"}",
"{"AccountType":"Equity","AccountCode":"960","Name":"Retained Earnings"}",
"{"AccountType":"Equity","AccountCode":"970","Name":"Owner A Share Capital"}"
]


I want in this format:-

[Object, Object, Object, Object, Object, Object, Object, Object]

Array[62]
0
:
Object
$$hashKey
:
"object:3216"
AccountCode
:
"090"
AccountType
:
"Bank"
Name
:
"Business Bank Account"
__proto__
:
Object
1
:
Object
2
:
Object

Answer

Try this:

let objectArray = json.map((each)=>{return JSON.parse(each)});
console.log(objectArray) // This will give you the required output