i have a string
var traingIds = \"${triningIdArray}\"; // ${triningIdArray} this value getting from server alert(traingIds) // alerts [1,2] var type = typeof
Change
var trainindIdArray = traingIds.split(',');
to
var trainindIdArray = traingIds.replace("[","").replace("]","").split(',');
That will basically remove [ and ] and then split the string
[
]