function createButtonsAfterResult() {
    optionButtonsContainer.innerHTML = "";
    let searchTerm = getSearchTerm("search-input");
    const suggestionResults = suggestionsFromAPI(searchTerm);
    suggestionResults
        .then(obj => {
            const suggestionArray = obj.data;
            if ((suggestionArray.length > 0)) {
                let results = suggestionArray.length >= 4 ? 4 : suggestionArray.length;
                for (let i = 0; i < results; i++) {
                    let myBtn = createOptionButton(suggestionArray[i].name);
                    optionButtonsContainer.appendChild(myBtn);
                }
            } else {
                let defaultArray = ["kitties", "puppies", "fab five", "thumbs up"];
                for (let i = 0; i < defaultArray.length; i++) {
                    let myBtn = createOptionButton(defaultArray[i]);
                    optionButtonsContainer.appendChild(myBtn);
                }
            }
        })
        .catch(e => console.log(e))
}
// creates the option buttons that are passed to the container after a search is performed
creates the option buttons that are passed to the container after a search is performed
creates the option buttons that are passed to the container after a search is performed
function createButtonsAfterResult() {
    optionButtonsContainer.innerHTML = "";
    let searchTerm = getSearchTerm("search-input");
    const suggestionResults = suggestionsFromAPI(searchTerm);
    suggestionResults
        .then(obj => {
            const suggestionArray = obj.data;
            if ((suggestionArray.length > 0)) {
                let results = suggestionArray.length >= 4 ? 4 : suggestionArray.length;
                for (let i = 0; i < results; i++) {
                    let myBtn = createOptionButton(suggestionArray[i].name);
                    optionButtonsContainer.appendChild(myBtn);
                }
            } else {
                let defaultArray = ["kitties", "puppies", "fab five", "thumbs up"];
                for (let i = 0; i < defaultArray.length; i++) {
                    let myBtn = createOptionButton(defaultArray[i]);
                    optionButtonsContainer.appendChild(myBtn);
                }
            }
        })
        .catch(e => console.log(e))
}
function createButtonsAfterResult ( ) { optionButtonsContainer . innerHTML = "" ; let searchTerm = getSearchTerm ( "search-input" ) ; const suggestionResults = suggestionsFromAPI ( searchTerm ) ; suggestionResults . then ( obj => { const suggestionArray = obj . data ; if ( ( suggestionArray . length > 0 ) ) { let results = suggestionArray . length >= 4 ? 4 : suggestionArray . length ; for ( let i = 0 ; i < results ; i ++ ) { let myBtn = createOptionButton ( suggestionArray [ i ] . name ) ; optionButtonsContainer . appendChild ( myBtn ) ; } } else { let defaultArray = [ "kitties" , "puppies" , "fab five" , "thumbs up" ] ; for ( let i = 0 ; i < defaultArray . length ; i ++ ) { let myBtn = createOptionButton ( defaultArray [ i ] ) ; optionButtonsContainer . appendChild ( myBtn ) ; } } } ) . catch ( e => console . log ( e ) ) }
creates the option buttons that are passed to the container after a search is performed
creates the option buttons that are passed to the container after a search is performed