I have a nested map as follows:
Map x = {
'A' : {
'name' : 'Will',
'age' : 60
},
'B' : {
'name' : 'Smith',
'age' : 57
}
};
So I just want to remove the age
at B
only and it will be like this:
{A: {name: Will, age: 60}, B: {name: Smith}}
I'm not sure how to use .removeWhere
for nested maps.
CodePudding user response:
I think the most obvious solution is this:
x['B'].remove('age');
CodePudding user response:
you just need to use .remove
function of list
list['B'].remove('age');
output