var userChosenBadges - ['Next.js', 'React']
function generateFrameworkBadges(userChosenBadges) {
var badgeUrlArray = [];
for (let i = 0; i < userChosenBadges.length; i++) {
switch (userChosenBadges[i]) {
case 'Next.js':
badgeUrlArray.push('url1')
break;
case 'React':
badgeUrlArray.push('url2')
break;
case 'Vue':
badgeUrlArray.push('url3')
break;
case 'Angular':
badgeUrlArray.push('url4')
break;
case 'Svelte':
badgeUrlArray.push('url5')
break;
case 'Laravel':
badgeUrlArray.push('url6')
break;
case 'Bootstrap':
badgeUrlArray.push('url7')
break;
case 'jQuery':
badgeUrlArray.push('url8')
break;
}
}
console.log(badgeUrlArray);
console.log(userChosenBadges);
if (badgeUrlArray) {
for (let i = 0; i < badgeUrlArray.length; i++) {
console.log(`![${userChosenBadges[i]}](${badgeUrlArray[i]})`)
return `![${userChosenBadges[i]}](${badgeUrlArray[i]})`;
}
}
}
generateFrameworkBadges(userChosenBadges)
I expected two badges to be returned in markdown format:
 
However, I only get:

The intended logic is that the for loop will execute a switch statement to return the relevant link for each item in the array. However, it appears only to do so for the first array item.