import React from 'react';
function App(){
const myCity = ['Indore','Mumbai','Pune','Hyderabad'];
const listItems = myCity.map((myCity)=>{
return <li>{myCity}</li>;
});
return(
<ul> {listItems} </ul>
);
}
export default App;
Output:
Indore
Mumbai
Pune
Hyderabad
import React from 'react';
import ReactDOM from 'react-dom';
function App(props) {
const numbers = props.numbers;
return (
<div>
<ul>
{numbers.map((number) =>
<li>{number}</li>
)}
</ul>
</div>
);
}
const numbers = [1, 2, 3, 4, 5];
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App numbers={numbers} />);
export default App;
Output:
1
2
3
4
5
import React from 'react';
import ReactDOM from 'react-dom';
function App(props) {
const numbers = props.numbers;
return (
<div>
<ul>
{numbers.map((number) =>
<li key={number.toString()}>{number}</li>
)}
</ul>
</div>
);
}
const numbers = ['Indore', 'Mumbai', 'Pune', 'Hyderabad', 'Banglore'];
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App numbers={numbers} />);
export default App;
Output:
1 Indore
2 Mumbai
3 Pune
4 Hyderabad
5 Banglore
Trainings :
Data Science Training in Indore | React JS Training in Indore | Blockchain Training in Indore | Data Analytics Training in Indore | Python Training in Indore |Free Courses and Resource :
Dart | OpenCV Tutorials | Projects | Interview Questions | Python Data Structures and Algorithms | Aptitude Tests | Verbal Aptitude | Matplotlib Tutorials | Examples | Interview Questions | HackerRank Python | Pandas Tutorials | Projects | Interview Questions | Rust Tutorials | Projects | Interview Questions | ExpressJS Tutorials | Projects | Interview Questions | Django | MongoDB Tutorials | Examples | Interview Questions | HackerRank C Program Solutions | Python Tutorials by CodersDaily | React.js Tutorials | Golang Tutorials | Projects | Interview Questions | MS Sql Server Tutorials | Examples | Interview Questions | Verbal Ability Tutorial | Numpy Tutorials | Projects | Interview Questions | Power BI Tutorials | Projects | Interview Questions | Example Dashboards | Tensor Flow | HackerRank C++ Solutions | Django REST Framework Tutorial | CodeChef Python Solutions | Leetcode Python Solutions | Reasoning Ability Tutorial | Quantitative Ability Tutorial | C++ Tutorials | HackerRank Java Solutions | TCS NQT Mock Test Series |Interview Questions :
Pandas Tutorials | Projects | Interview Questions | ExpressJS Tutorials | Projects | Interview Questions | Django | Python Tutorials by CodersDaily | React.js Tutorials | Golang Tutorials | Projects | Interview Questions | Numpy Tutorials | Projects | Interview Questions | Django REST Framework Tutorial |Top Colleges in India :
Indian Institute of Technology Bombay | Jaypee University of Engineering and Technology - Guna |