1function NameList() {
2 const names = ['Bruce', 'Clark', 'Diana']
3 return (
4 <div>
5 {names.map(name => <h2>{name}</h2>)}
6 </div>
7 )
8}
1const numbers = [1, 2, 3, 4, 5];
2const doubled = numbers.map((number) => number * 2);
3console.log(doubled);