Grouping array elements by a property
JavaScript
Read fire tipconsole
is an object like any other. That means we can destructure from it like we do with other objects as well.
// Tired of writing “console.” all the time?
console.log('This sure is tiresome.')
console.warn('That’s a lotta keystrokes.')
// Destructure the functions from the console object.
const { log, warn } = console
log('Look ma, no console!')
warn('I’m going to let you do whatever.')
When a feature calls for the first five photos from a list and a link that says “27 more photos”, we can split the list of photos into these two blocks.