let products = [
{
title: 'test',
src: 'test.html'
},
{
title: 'test',
src: 'test2.html'
}
];
let custom_products = products.map(function(product) {
return {
name: product.title,
url: product.src
};
})
// output
[
{
name: 'test',
url: 'test.html'
},
{
name: 'test',
url: 'test2.html'
}
]