I have an array of objects which is a string.
[{
'version_name': '1.4',
'url': 'url'
},
{
'version_name': '1.3',
'url': 'url'
},
{
'version_name': '1.2',
'url': 'url'
},
{
'version_name': '1.1',
'url': 'url'
}]
I am using this code to remove all the space:
str = str.replace(/\s+/g, '');
Now, I want to convert it to proper array of objects. How do i do that?
I tried string.split()
which kind of works but each array element becomes a string instead of an object.