I have a Spring Controller which passes a Set of Strings to the view but as a single String:
"[AB, NK, LK]"
However, I need to convert the above String into an equivalent JavaScript array like the following:
["AB", "NK", "LK"]
I have tried the following jQuery to iterate through the String "[AB, NK, LK]" in order to add these values to a <select> tag:
$.each(arrayCodes, function(index, value) {
$("#select").append("<option value='" + value + "'>" + arrayCodeValues[index]
+ "</option>");
});
JSON.parse?