Here is an array of objects:
{
"attr1": 123,
"attr2": "a.end",
},
{
"attr1": 123,
"attr2": "b.start",
}
The task is to remove the first part of the attr2 string up to and including the '.'.
An attempted solution involved using:
arr.map ((item:any) => item.attr2 = item.attr2.split('.').pop())
However, an editor displayed the following arrow:
Arrow function should not return assignment.eslintno-return-assign
The objective is for the array 'arr' to look like this:
{
"attr1": 123,
"attr2": "end",
},
{
"attr1": 123,
"attr2": "start",
}