fmmshadiq,
<script>
const workers = [
{
name : 'maxim',
lastname : 'ivanov'
},
{
name : 'ivan',
lastname: 'borisov'
}
];
function namestoupper(arr) {
arr.forEach(obj => {
for (let key in obj) {
obj[key.toUpperCase()] = obj[key];
delete obj[key]
}
})
}
namestoupper(workers);
document.write(`<pre>${JSON.stringify(workers, "", 1)}</pre>`)
</script>
|