render a list using array filter react
import React from 'react';
const people = [
{
name: 'James',
age: 31,
},
{
name: 'John',
age: 45,
},
{
name: 'Paul',
age: 65,
},
{
name: 'Ringo',
age: 49,
},
{
name: 'George',
age: 34,
}
];
function App() {
return (
<div>
{people.filter(person => person.age < 60).map(filteredPerson => (
<li>
{filteredPerson.name}
</li>
))}
</div>
);
}
export default App;react rendering using array.filter
Also in JavaScript:
- nodelist to array
- make angular to run on a different port
- javascript countdown timer
- js get query param
- scrollbar position
- string contains javascript
- svn node remains in conflict
- jquery for element which doesnt exist on page load
- reacts mos twanted
- preload sprite phaser
- javascript string first letter lowercase
- Create a server which serves at port 3000 and with node.js command prompt
- checking if a user has a role in discord js
- javascript replace multiple spaces with single space
- javascript keyboard events
- set dropdown in jquery
- json example array
- what is .eslint.js in vue
- get the name of month without using hard coded arrays in javascript
- events in javascript
- p5js add canvas in middle
- reduce method in javascript array of bjects
- react lifecycle hooks
- import leaflet js