I have a problem while making code as a function.
this is my original code which is run well.
var list = '<ul>';
var o = 0;
while (o < files.length) {
list = list + `<li><a href='/?id=${files[o]}'>${files[o]}</a></li>`;
o++;
}
list = list + '</ul>';
console.log(list);
and this is the function I made that doesn't work well.
function makeList(){
var list = '<ul>';
var o = 0;
while (o < files.length) {
list = list + `<li><a href='/?id=${files[o]}'>${files[o]}</a></li>`;
o++;
}
list = list + '</ul>';
return;
}
makeList();
console.log(list);