Implement a deepOmit function
An omit operation on an object is not formally defined in JavaScript, but in general it is widely understood as the process of removing or filtering out certain values based on a condition.
1. Basic implementation
Implement the deepOmit()
utility, that removes specified keys and their corresponding values from an object, including nested objects or arrays. Do not mutate the original input.
In the above implementation , I have used a utility called isPojo()
, which essentially checks if the given value is a Plain Old JavaScript Object or not. You can learn more about it’s implementation in the deepEqual function implementation from the Recursion Questions for Frontend Interviews blog series.
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 🫡.