I am attempting to create a custom function that can convert the keys of an object I am accessing into a string representation. Here is an example:
const test = {
propertyOne: {
propertyTwo: 0
},
propertyThree: {
propertyFour: 0
}
}
function ObjectKeysToString(objectReceived) {
...
return stringfiedObjectReceived
}
Input:
test.propertyOne.propertyTwo
ObjectKeysToString(test.propertyOne.propertyTwo)
Output: "test.propertyOne.propertyTwo"
Do you think this task is achievable?
I have made efforts to find a solution and explored various Object methods, but unfortunately, none of them have worked for me so far.