diff --git a/public/js/main.js b/public/js/main.js index af3f4fa..56d876f 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -55,8 +55,9 @@ function renderMatches(matches) { const list = document.getElementById('result-list'); list.innerHTML = ''; - // For every match found, render the objects to the DOM in JSON format - if (matches.length > 0) { + // If matches exist, render each match to the DOM + if(matches.length) { + // For every match found, render the objects to the DOM in JSON format matches.forEach(match => { const li = document.createElement('li'); @@ -68,8 +69,9 @@ function renderMatches(matches) { list.appendChild(li); }); } else { + // Display "No matches were found" in result-list