I recommend trying promises out, start by working with promises before creating them. A promise that you could work with is the fetch api for example, google has a good introduction
constgetJson=res=>{// comment out the if to return the error // and see how catch worksif(res.status!==200){returnnewError(`StatusCode: ${res.status}`)}returnres.json()}constgetUrl=url=>fetch(url).then(getJson)getUrl('https://baconipsum.com/api/?type=meat-and-filler').then(res=>console.log(res)).catch(err=>console.error(err.message))
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I recommend trying promises out, start by working with promises before creating them. A promise that you could work with is the fetch api for example, google has a good introduction