Program
function ListItem(props) {
return <li>{props.value}</li>;
}
function NList(props) {
const numbers = props.numbers;
return (
<ul>
???
</ul>
);
}
const numbers = [8, 6, 4, 2, 1];
ReactDOM.render(
<NList numbers={numbers} />,
document.getElementById('root')
);
Output
• 8
• 6
• 4
• 2
• 1
" class="related-a">
Which of the following code snippets should be there in place of "???" in the below given program so that the following output is printed on the console?
Program
function ListItem(props) {
return <li>{props.value}</li>;
}
function NList(props) {
const numbers = props.numbers;
return (
<ul>
???
</ul>
);
}
const numbers = [8, 6, 4, 2, 1];
ReactDOM.render(
<NList numbers={numbers} />,
document.getElementById('root')
);
Output
• 8
• 6
• 4
• 2
• 1