From d5efb9cc1be799d16e5e73986e0e835473b5c837 Mon Sep 17 00:00:00 2001 From: Brian Schnee <77141303+brianschnee@users.noreply.github.com> Date: Mon, 13 Jun 2022 23:03:42 -0400 Subject: [PATCH 1/4] Updated Comments --- public/js/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 0d97e33..ad07309 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -39,8 +39,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'); @@ -52,8 +53,9 @@ function renderMatches(matches) { list.appendChild(li); }); } else { + // Display "No matches were found" in result-list