arguments is an Array-like object accessible inside functions that contains the values of the arguments passed to that function.
.block { overflow-x: hidden; }
, чтобы не было прокрутки.const { items } = JSON.parse(json).response;
const html = `
<tbody>${items.map(n => `
<tr>
<td>${n.title}</td>
<td>${n.director}</td>
<td>${n.year}</td>
<td>${Object.values(n.photo).map(m => `<img src="${m}">`).join('')}</td>
</tr>`).join('')}
</tbody>
`;
$('#example').append(html);
// или
document.querySelector('#example').insertAdjacentHTML('beforeend', html);
items.forEach(function(n) {
const tr = this.insertRow();
tr.insertCell().textContent = n.title;
tr.insertCell().textContent = n.director;
tr.insertCell().textContent = n.year;
tr.insertCell().append(...Object.values(n.photo).reduce((acc, m) => (
(acc[acc.length] = new Image).src = m,
acc
), []));
}, document.getElementById('example').createTBody());
Помогите пожалуйста специалисту, который только возобновил работу после 3 лет декретного отпуска:)
select foo from apartments a
left join user_table u on u.id=a.user_id AND a.publisher_type=0
left join organization_table o on o.id=a.organization_id AND a.publisher_type=1
const elements = document.querySelectorAll('.list li');
// или
const elements = document.querySelector('.list').children;
const str = Array
.from(elements, n => n.textContent)
.join(' ');
// или
const str = ''.concat(...Array.prototype.flatMap.call(
elements,
(n, i) => [ i ? ' ' : '', n.innerText ]
));
// или
const str = [...elements].reduce((acc, n, i) => {
return acc + (i ? ' ' : '') + n.innerHTML;
}, '');
// или
const str = (function get(i, n = elements.item(i)) {
return n
? `${i ? ' ' : ''}${n.lastChild.nodeValue}${get(-~i)}`
: '';
})(0);