const users = [
{
id: '1',
firstName: 'Марк',
lastName: 'Визельман',
email: 'mark@gmail.com'
},
{
id: '2',
firstName: 'Кирилл',
lastName: 'Давсон',
email: 'kirill@gmail.com'
},
{
id: '3',
firstName: 'Виктор',
lastName: 'Ганеш',
email: 'victor@gmail.com'
}
]
const usersList = [
'Марк Визельман mark@gmail.com',
'Кирилл Давсон kirill@gmail.com',
'Виктор Ганеш victor@gmail.com'
]
const usersList = users.map(n => `${n.firstName} ${n.lastName} ${n.email}`);
const usersList = users.map(function(n) {
return this.map(k => n[k]).join(' ');
}, [ 'firstName', 'lastName', 'email' ]);
const users = [
{
id: '1',
firstName: 'Марк',
lastName: 'Визельман',
email: 'mark@gmail.com'
},
{
id: '2',
firstName: 'Кирилл',
lastName: 'Давсон',
email: 'kirill@gmail.com'
},
{
id: '3',
firstName: 'Виктор',
lastName: 'Ганеш',
email: 'victor@gmail.com'
}
]
const usersList = users.map(item=>item.firstName+" "+item.lastName+" "+item.email);