I'm currently working on a project that involves utilizing the Wikipedia API. My goal is to create a link for each list item, but I'm encountering difficulty with proper concatenation.
Here's the code snippet I'm using:
for (var j=0; j < wikiData.length; j++) {
var articleAuthor = wikiData[1][j];
var articleInfo = wikiData[2][j];
var linkAuthor = wikiData[3][j];
domCache.$wikiArticlesList.append('<li class="articleItem">'+ '<span>' + '<a href =' + '"linkAuthor">' + articleAuthor + '</a>' + '</span>' +'<span class="shortInfo">' + articleInfo +'</span>' + '</li>');
console.log(j + " " + articleAuthor);
console.log(j + " " + articleInfo);
console.log(j + " " + linkAuthor);
}
The problematic line of code: var linkAuthor = wikiData[3][j];
I am struggling to correctly concatenate the 'linkAuthor' variable to the 'href' attribute. I understand that the issue lies in the usage of apostrophes, but I can't seem to figure it out on my own. Any fresh perspective or assistance would be greatly appreciated.