I couldn't get JSON.parse to convert a string to an object and I found this code which solves my problem - however, I can't figure out how it works. I would be grateful if someone can explain (to a JavaScript beginner) what's going on in the 3rd line. Thank you.
var str, obj;
str = "{src:'img/testimage.jpg', coord:{x:17, y:39}, width:200, height:200}";
obj = new Function('return '+str)();