I'm currently trying to implement a function that randomly generates a random number of span tags using a loop. If I wrap the span tags in a string then the spans render onto my page as a string, however, if I don't wrap it in a string, it renders as an object.
Does anyone know of a way to handle this?
function generateRandomStarCount (){
Math.round(Math.random()*5)
let result = '';
for (var i = 0; i < Math.round(Math.random()*5); i++){
result += '<span className="fa fa-star checked"></span>'
}
return result;
}