JavaScript
4
Вклад в тег
function translateY(e) {
if (!e.classList.contains('translate')) {
e.classList.add('translate');
e.addEventListener('transitionend', function handler() {
e.classList.remove('translate');
e.removeEventListener('transitionend', handler);
});
}
}
function sumNumbers(start, end) {
let sum = 0;
for (let i = start; i <= end; i++) {
sum = sum + i;
}
return sum;
}
console.log(sumNumbers(-5, 5)); // выводит 0
this.$store.dispatch(actionTypes.addEvent, this.$route.params.id, {
title: this.title,
description: this.description,
startDate: this.startDate,
endDate: this.endDate
}).then(event => {
console.log(event);
this.$router.push({ name: "editUser" });
});
const addEvent = (id, credentials) => {
return axios.post(`/user/${id}`, credentials);
};
export default { getEvents, addEvent };