Is there a way to create a function called removeStar that removes the star key from an object and outputs it in the format shown by the expectedOutput variable?
let input = {
"p": {
"pk1": "pv1",
"pk2": "pv2",
"c": {
"*": {
"ck1": "cv1",
"ck2": "cv2"
}
}
}
}
function removeStar(input) {
// Looking for suggestions on how to implement this function.
}
let expectedOutput = {
"p": {
"pk1": "pv1",
"pk2": "pv2",
"c": {
"ck1": "cv1",
"ck2": "cv2"
}
}
};
console.log(removeStar(input));