I have following code: my code
I need to check if my elements name.length sum count is greater than 25 then only show items whose name.length sum is less than 25. And also print count of items which are not shown.
I am trying something like this, but I stuck, please help :)
const skills = [
{
id: 1,
name: "Html"
},
{
id: 2,
name: "css"
},
{
id: 3,
name: "bootstrap 4"
},
{
id: 4,
name: "scss"
},
{
id: 5,
name: "JS"
},
{
id: 6,
name: "React"
},
{
id: 7,
name: "Jquery"
},
{
id: 8,
name: "Vue JS"
}
];
return (
<div>
{skills.map((skill) => (
<li key={skill.id}>{skill.name}</li>
))}
{/* with this line I am wanting to show each elemet char count */}
{skills.map((skill) => (
<div>{skill.name.length}</div>
))}
{/* need to show hide elements count */}
<div>+{count}</div>
</div>
);
In the end I need to get view like this
- Html
- css
- bootstrap 4
- scss
- JS
+3
