Programming Exercises

Write a component that dynamically renders a list of user profiles passed as hardcoded props.

Easy

Problem Statement

Write a component that dynamically renders a list of user profiles passed as hardcoded props.

Sample Input

users = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]

Sample Output

Alice
 Bob

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React from "react"; const UserList = (props) => { // Map over props.users to render the list }; export default UserList;
Log in or sign up to run or submit your code.Log inSign up
Input
users = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]
Expected Output
Alice
 Bob