i have a string
var traingIds = \"${triningIdArray}\"; // ${triningIdArray} this value getting from server alert(traingIds) // alerts [1,2] var type = typeof
Assuming, as seems to be the case, ${triningIdArray} is a server-side placeholder that is replaced with JS array-literal syntax, just lose the quotes. So:
${triningIdArray}
var traingIds = ${triningIdArray};
not
var traingIds = "${triningIdArray}";