I've got an array with objects created dynamically. I'll use the next example:
const workers = [{
Construction: 500,
workers: 0
},
{
Debilite: 800,
workers: 0
},
{
Marketing: 1200,
workers: 0
},
{
'Human Resources': 1350,
workers: 0
},
]
How to find if the property name exists and change its value? For example, if 'Construction' property exists, change its value from 500 to 800 and workers should change from 0 to 1.