function printResults(){
    templates.searchResults = Handlebars.compile(`
    {{#if (isdefined this)}}
        {{#each this}}
            <section class="book-container"  id="{{workid}}">
                <section class="book-title">
                    {{#if (isfav workid)}}
                        <button id="book-key-{{@key}}_active" target="_book-favorite"><i class="fa fa-heart" aria-hidden="true"></i></button>
                    {{else}}
                        <button id="book-key-{{@key}}" target="_book-favorite"><i class="fa fa-heart-o" aria-hidden="true"></i></button>
                    {{/if}}
                    <h2 class="book-title"">{{titleweb}}</h2>
                    <q class="book-author">Written By: {{authorweb}}</q>
                </section>                                          
                {{#if (isdefined titles.isbn)}}
                    <figure><img class="book-picture" alt="book-cover-{{workid}}" src = "https://reststop.randomhouse.com/resources/titles/{{titles.isbn.0.$}}" height="200px"></figure>
                {{else}}
                    <figure><img class="book-picture" alt="book-cover-{{workid}}" src = "https://reststop.randomhouse.com/resources/titles/{{titles.isbn.$}}" height="200px"></figure>
                {{/if}}
            </section>
        {{/each}}
    {{else}}
        <figure id="no-results">
            <img alt="no-results" src="@Resources/search.png" height="200px">
            <figcaption>Could not find any results for your search.</figcaption>
        </figure>
    {{/if}}`)
    let temp = templates.searchResults(works)
    let div = document.getElementById("title-list")
    div.innerHTML = temp
}
/**
 * If users search returns results, display them, else display a 'results no found' page
 * If results are displayed, check if work is already favorited to display appropriate heart icon
 * Last if is about the displayed book covers, some works returned a single title which resulted in a single object,
 *      while others returned multiple titles which resulted in an array of objects
 */
If users search returns results, display them, else display a 'results no found' page
If results are displayed, check if work is already favorited to display appropriate heart icon
Last if is about the displayed book covers, some works returned a single title which resulted in a single object,
while others returned multiple titles which resulted in an array of objects
If users search returns results display them else display a ' results no found ' page If results are displayed check if work is already favorited to display appropriate heart icon Last if is about the displayed book covers some works returned a single title which resulted in a single object while others returned multiple titles which resulted in an array of objects
function printResults(){
    templates.searchResults = Handlebars.compile(`
    {{#if (isdefined this)}}
        {{#each this}}
            <section class="book-container"  id="{{workid}}">
                <section class="book-title">
                    {{#if (isfav workid)}}
                        <button id="book-key-{{@key}}_active" target="_book-favorite"><i class="fa fa-heart" aria-hidden="true"></i></button>
                    {{else}}
                        <button id="book-key-{{@key}}" target="_book-favorite"><i class="fa fa-heart-o" aria-hidden="true"></i></button>
                    {{/if}}
                    <h2 class="book-title"">{{titleweb}}</h2>
                    <q class="book-author">Written By: {{authorweb}}</q>
                </section>                                          
                {{#if (isdefined titles.isbn)}}
                    <figure><img class="book-picture" alt="book-cover-{{workid}}" src = "https://reststop.randomhouse.com/resources/titles/{{titles.isbn.0.$}}" height="200px"></figure>
                {{else}}
                    <figure><img class="book-picture" alt="book-cover-{{workid}}" src = "https://reststop.randomhouse.com/resources/titles/{{titles.isbn.$}}" height="200px"></figure>
                {{/if}}
            </section>
        {{/each}}
    {{else}}
        <figure id="no-results">
            <img alt="no-results" src="@Resources/search.png" height="200px">
            <figcaption>Could not find any results for your search.</figcaption>
        </figure>
    {{/if}}`)
    let temp = templates.searchResults(works)
    let div = document.getElementById("title-list")
    div.innerHTML = temp
}
function printResults ( ) { templates . searchResults = Handlebars . compile ( ` ` ) let temp = templates . searchResults ( works ) let div = document . getElementById ( "title-list" ) div . innerHTML = temp }
If users search returns results, display them, else display a 'results no found' page
 If results are displayed, check if work is already favorited to display appropriate heart icon
 Last if is about the displayed book covers, some works returned a single title which resulted in a single object,
      while others returned multiple titles which resulted in an array of objects
If users search returns results display them else display a ' results no found ' page If results are displayed check if work is already favorited to display appropriate heart icon Last if is about the displayed book covers some works returned a single title which resulted in a single object while others returned multiple titles which resulted in an array of objects