let arr = [
{
"name": "крафт.gif",
"offset": 964
},
{
"name": "авария.gif",
"offset": 681
},
{
"name": "животные.gif",
"offset": 777
}
];
arr.forEach(n => {
if (n.name === 'животные.gif') {
n.offset = 500
}
})
console.log(arr)
let result = 1;
for (let i = 1; i <= 100; i++) {
result *= i
}
async upload(e) {
e.preventDefault()
const formData = new FormData()
formData.append('performer', this.performer)
formData.append('album', this.album)
for (let file of this.audio) {
formData.append('audio', file)
}
formData.append('preview', this.preview[0]);
try {
const res = await fetch(`${keys.BASE_URL}/music/add`,
{
method: 'POST',
body: formData
}
);
const result = await res.json()
this.success = result.success
this.id = result.id
} catch (e) {
}
}
const wrapper = document.querySelector('.wrapper')
let index = 8
let div = document.createElement('div')
div.textContent = index
wrapper.append(div)