мне возвращает в данном случае функцию, а не num
function chain(num) {
const sum = val => { // sum - функция
num += val
console.log(num)
return sum.bind(val)
}
sum.valueOf = () => num
sum.toString = () => num
return sum // и тут мы ее возвращаем
}
let test = [1, 2, 10]
[1, 2, 3, 4, 5, 6, 7].filter(x => test.includes(x))
x => test.includes(x)
)function inArray(test) {
return x => test.includes(x);
}
- [1, 2, 3, 4, 5, 6, 7].filter(x => test.includes(x))
+ [1, 2, 3, 4, 5, 6, 7].filter(inArray(test))
formData.append("avatar-upload",file);
$path = $request->file('image')->store("app/public","public");
.files[0]
if (files.length > 0)
- const file = fileInput.files;
+ const file = fileInput.files[0];
files
– это массив (почти, на самом деле коллекция FileList).for (let i = 0; i < fileInput.files.length; i++) {
const file = fileInput.files[i];
formData.append("avatar-upload[]", file);
}
index.php?route=module/loadMore
у вас отдаёт данные. Он должен знать, есть еще или нет. Он же должен вернуть json данные в предложенном формате.