I am currently dealing with a web service that returns an array of strings to a client. From here, I would like to take this array of strings and convert it to an object that gives each row a name to refer to it later.
So start with this one:
var result = ["test", "hello", "goodbye"];
And I would like to end up with:
var final = [{'value': "test"}, {'value': "hello"}, {'value': "goodbye"}];
I am using jquery. Is it easy to do?
source
share