I tried to trim in an object inside objects but it's not working. anyone give the example code trim in an object inside the object.
Example
const data = {tgg:" egg ",ggg:{dfgf:" tyt "}, ff:[{tyuyy:" sd f "}]}
how to trim this object in all scenario
Excepted Output
{tgg:"egg",ggg:{dfgf:"tyt"}, ff:[{tyuyy:"sd f"}]}
Only remove first and back space