.burder {
// основные стили
}
.page-scrolled .burger {
// Стили применяемые при скролле
}
function scrollFunction() {
let condition = document.body.scrollTop > 50 //...;
document.body.classList.toggle('page-scrolled', condition);
}
мне возвращает в данном случае функцию, а не 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);
}