I define a javascript that looks like thise:
async function searchPerson(item){
    const url = window.location;
    const response = await fetch(url.origin+"/api/persons/search/1/"+item);
    const person = await response.json();
    //console.log(person);
    return person;
}
and so in my eventListener, i am calling that method just like this:
if(document.getElementById('search-person')){
    document.getElementById('search-person').addEventListener('click', (e)=>{
         item = document.getElementById('input_search_person_ref_number').value;
         if(item){
             const person= async ()=>{
                 searchPerson(item);
             }
             //const person = await searchPerson(item);
             console.log(person);
         } 
    }
}
Upon running i am getting an out put like this:
async ()=>{
    searchPerson(item);
}
if i use const person = await searchPerson(item); i have to make addEventListener async too. Is there other way to get it (return value promise) without making addEventListener asynchronous?
 
    