It’s not that there are double quotes around
+ val.imageLink + … instead, there are double quotes around the strings to either side of
+ val.imageLink +. Those strings include a single quote
Your finished html needs to look like this, for example:
<img src='http://someurl.com/image.jpeg'>. The url needs to be in quotes - that’s why each of the strings includes the single quote
'. You have to include the single quote in the strings because it won’t be a part of the image url variable. When combined, the url ends up wrapped in quotes.
What the code snippet does is concatenate three things: a leading string, a variable and the terminating string. You could rewrite it like this:
var imgStart = "<img src = '";
var imgEnd = "'>"
var imgLink = "http://someurl.com/image.jpeg";
html += imgStart + imgLink + imgEnd;