const promise = files.map(file => {
const storageRef = ref(storage, `${name}/${file.name}`);
uploadBytes(storageRef, file)
.then((snapshot) => {
return getDownloadURL(snapshot.ref)
})
.then((url)=>{
arr.push(url);
})
})
Promise.all(promise).then(() => {
// другая функция
})