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});