Hey there! I've got a query. So, I have this array of objects and my goal is to convert the id of each object in the array into uppercase. Initially, I accomplished this using the following lines of code:
let x = [
{ id: "anc",path: "kdsfjdklsfj"},
{ id: "anc",path: "kdsfjdklsfj"},
{ id: "anc",path: "kdsfjdklsfj"},
]
x = x.map ( (a) => {return {
id : a.id.toUpperCase(),
path : a.path
}})
However, I feel like this approach may not be the most efficient because if the object has additional values, they would need to be repeated in the map function. Is there a more optimal solution for achieving this task?
Appreciate any insights you can offer!