async function getData() {
const url = document
.querySelector(`[data-id="${window.location.hash.substring(1)}"]`)
?.dataset.url; // Вот здесь этот спасительный знак =)
if (!url) return;
const response = await fetch(url);
const data = await response.json();
return data;
}
.fotbar-nav {
font-size: 130%;
}
ul {
display: flex;
list-style: none;
gap: 10px;
}
.nav_link {
color: #fff;
}
.end_foot {
text-align: center;
color: #fff;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-size: 15px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
{ name: 'Вася', age: 25 }
function getAvarageAge(arr) {
return arr.reduce((sum, item) => sum + item.age, 0) / arr.length;
}
let vasya = { name: 'Вася', age: 25 };
let petya = { name: 'Петя', age: 30 };
let masha = { name: 'Маша', age: 29 };
let arr = [vasya, petya, masha];
console.log(getAvarageAge(arr)); // 28
data: {
projects: [ ... ]
}
<div class="project" v-for="p in projects">
<div class="project__pin">{{ p.pin }}</div>
</div>