I have been trying to figure this out for a while, and I cannot wrap my head around how to do this. I dynamically created a function composed of different strings, and I would like to be able to turn this into actual javascript that can be called on.
I simplified this example but it still should help solve my problem.
var previewStringFunction = "function updateMap() {"
+ "some javascript code" + "}"
evalit but it's bad practice.