Javascript examples for Array:map
Map over properties in array and concat a string
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from ww w . j av a 2 s. c om*/ const authors = [ { id: 1, name: 'Steven'}, {id: 2, name: 'Nick'}] let names = authors.map( (a, i) => `${a.name} is cool`).join(' '); console.log(names); } </script> </head> <body> </body> </html>