Example:
$.map($.parseJSON(response), function(item) { return { value: item.tagName, data: item.id }; }) Here server will be returning the "response" in JSON format, by using $.parseJSON it is converting JSON object to Javascript Object array.
VyBy using $.map for each object value it will call the function(item) to display the result value: item.tagName, data: item.id