const concatenateEditionFields = (
pack: PackType,
edition: IEditionMetadata,
fieldName: string
) => {
const packField = pack[fieldName] || '',
editionField = edition[fieldName] || '',
concatenated = `${packField} ${editionField}`.trimLeft(),
isLanguageEqual = !edition.language || edition.language === pack.language
if (isLanguageEqual) {
return concatenated
} else if (fieldName === 'slugline') {
return edition.addToPackSlug ? concatenated : editionField
}
return editionField
}
const reverse = (str) => {
const len = str.length;
if (len === 0) {
return str;
}
console.log('str =', str, '; len =', len, '; result =', str[len - 1], '+', str.substr(0, len - 1))
return str[len - 1] + reverse(str.substr(0, len - 1));
};
const reverse = str => str.split('').reverse().join('');
const image = document.querySelector('.bee');
console.log(image.getAttribute('src'))
let sumTo = function (n) {
let sum = 0;
for (let i = 0; i < n; i++) {
sum += i;
}
console.log (sum);
}
sumTo(5);
const sumTo = n => Array.from({ length: n }, (v, k) => k).reduce((a, i) => (a + i), 0);
const sumTo = n => n.reduce((a, i) => (a+i), 0)
const response = await models.Cartridge.bulkCreate([...], {returning: true});
const response = await models.Cartridge.bulkCreate([...], {individualHooks: true});
this.conut = this.conut - count;
this.count = this.count - count;
pointer-events: none;
Object.defineProperty(NodeList.prototype, "addEventListener", {
value: function (event, callback, useCapture) {
useCapture = ( !! useCapture) | false;
for (var i = 0; i < this.length; ++i) {
if (this[i] instanceof Node) {
this[i].addEventListener(event, callback, useCapture);
}
}
return this;
}
});
v-list-tile
менять с to
на @click
и там уже отслеживатьv-list-tile
есть пропса tag
, туда div отправить, по умолчанию берёт с router-link
, а там a
const isLoginValid = (login) => login.length >= 4 && login.length <= 16;
const addLogin = (logins, login) => {
if (isLoginValid(login)) {
if (isLoginUnique(logins, login)) {
logins.push(login);
console.log("Логин успешно добавлен!");
} else {
console.log("Такой логин уже используется!");
}
} else {
console.log("Ошибка! Логин должен быть от 4 до 16 символов");
}
}