Created
December 6, 2021 09:35
-
-
Save codewithbernard/5f3f014a5e048d7b2187ea3a1fbfaa65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const users = [ | |
| { name: "John", age: 24 }, | |
| { name: "Linda", age: 19 }, | |
| { name: "Josh", age: 33 } | |
| ]; | |
| function App() { | |
| const renderUsers = () => { | |
| const result = []; | |
| for (const user of users) { | |
| result.push(<li>{user.name}</li>); | |
| } | |
| return <ul>{result}</ul>; | |
| }; | |
| return <div className="App">{renderUsers()}</div>; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment