Implement a deepFlattenObject function
Flattening an object is not a standard defined in JavaScript, however, it is commonly understood as the process of flattening out all nested values within an object into a flat single-level key-value structure, where each key represents a unique path to the original nested value.
1. Basic implementation
Implement a deepFlattenObject
function which can flatten out nested objects into a single level key value pair result.
Consider primitives values will be present.
You can also refer to the Squash Object Keys implementation where there is a need to preserve the parent key when flattening the object.
Further Reading
I strongly encourage you to explore and tackle additional questions in my Recursion Questions for Frontend Interviews blog series.
By doing so, you can enhance your understanding and proficiency with recursion, preparing you to excel in your upcoming frontend interviews.
Wishing you best. Happy Interviewing 🫡.