I'm currently working on a recursive "massage" function that requires me to rename specific property keys. So far, I've attempted various recursive methods but haven't had much luck.
One task is to eliminate the word 'Array' from all arrays nested within a deeply nested object.
Here is an example input:
var data = {
test: {
testArray1: [
{
testArray2: [
{
sample: {
testArray3: [],
},
},
],
},
],
},
};
The desired output should look like this:
var result = {
test: {
test1: [
{
test2: [
{
sample: {
test3: [],
},
},
],
},
],
},
};