Array methods
const books = [
{ id: 'ISBN-9791191209563', title: '나의 친구 레베' },
{ id: 'ISBN-9791166113239', title: '연애의 행방' },
{ id: 'ISBN-9791158888367', title: '불온한 파랑' }
]
// find
books.find(({title}) => title.includes('레베카'))
// some
books.some(({title}) => title.length % 2 == 0)
// every
books.every(({title}) => title.length % 2 == 1)
// map → includes
books
.map(book => book.title)
.includes('연애의 행방')
// filter
books.filter((book, index) => index > 1)
// map → reduce
books
.map(({id}) => +id.replace(/ISBN-/, ''))
.reduce((result, next) => result + next, 0)Last updated