Answers for ".map() in react js"

29

map function in react

function NameList() {
	const names = ['Bruce', 'Clark', 'Diana']
    return (
    	<div>
      {names.map(name => <h2>{name}</h2>)}
      	</div>
    )
}
Posted by: Guest on October-15-2020
4

react map

const numbers = [1, 2, 3, 4, 5];
const doubled = numbers.map((number) => number * 2);console.log(doubled);
Posted by: Guest on June-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language