The "Whiskers & Paws" shelter asked Byte for a page of cats looking for a home. The server sends an array of objects { id, name, age, adopted } (age is in months), and on every update the page calls renderCats(cats) with the full list.
Write renderCats(cats). The <ul id="cats"> list must end up with exactly one item per cat, like this:
<li class="cat" data-id="1"><span class="name">Luna</span>, 4 mo.</li>
- a cat that has already been adopted (
adopted: true) also gets the class adopted; - names are typed by people, so they can contain any characters — the name
<i>Count</i> must appear as is, as text; - the
<p id="empty"> paragraph is visible (hidden is off) only when the list is empty.