найти объект
найти самое большое значение
const obj = arr.flat().reduce((max, n) => max?.age > n.age ? max : n, null);
const val = Math.max(...arr.flat().map(n => n.age));
Math.max(0, ...arr.reduce((acc, n, i, a) => (
n !== a[i - 1] && acc.push(0),
acc[acc.length - 1]++,
acc
), []))
arr.reduce((acc, n, i, a) => (
n !== a[i - 1] && (acc[1] = 0),
acc[0] = acc[+(++acc[1] > acc[0])],
acc
), [ 0, 0 ])[0]
Array.from(str, n => n < 5 ? 0 : 1).join('')
// или
[...str].reduce((acc, n) => acc + +(n >= 5), '')
// или
''.concat(...str.split('').map(n => Math.floor(n / 5)))
// или
[].map.call(str, n => -~-~-~n >> 3).join``
// или
str.replace(/./g, m => Number('56789'.includes(m)))
// или
str.replace(/[1-4]/g, 0).replace(/[5-9]/g, 1)
str.slice(1, -1).split(', ')
JSON.parse(str.replace(/[а-яё]+/g, '"$&"'))
str.match(/[^\s\[\],]+/g)
const columns = [...new Set(persons.flatMap(Object.keys))];
document.body.insertAdjacentHTML('beforeend', `
<table>
<thead>
<tr>
<th>#</th>
${columns.map(col => `<th>${col}</th>`).join('')}
</tr>
</thead>
<tbody>${persons.map((person, i) => `
<tr>
<th>${i}</th>
${columns.map(col => `<td>${person[col] ?? '-'}</td>`).join('')}
</tr>`).join('')}
</tbody>
</table>
`);