I have mutliple objects like this
{"name":"abc"},{"name":"pqr"},{"name":"xyz"}
I want a Javascript function that return comma-separated objects.
Is there some way to achieve this?
Expected return:
{"name":"abc"},{"name":"pqr"},{"name":"xyz"}
I tried by converting it in string and return by a function and then spliting but didnt get expected.
obj:function(){
var str = '{"name":"abc"},{"name":"pqr"},{"name":"xyz"}';
return str
}
obj().split(',')
2