constloadImageAsync=function(url){
return newPromise((resolve,reject)=>{
constimage=newImage()
image.onload=()=>{
resolve(image)
}
image.onerror=()=>{
reject(image)
}
image.src=url
})
}
constloadImageAsync=function(url){
return newPromise((resolve,reject)=>{
constimage=newImage()
image.onload=()=>{
resolve(image)
}
image.onerror=()=>{
reject(image)
}
image.src=url
})
}