is there a way to access a nested property within an object without knowing its path? For instance I could have something like this
let test1 = {
location: {
state: {
className: 'myCalss'
}
}
};
let test2 = {
params: {
className: 'myCalss'
}
};
Is there neat way to 'extract' className
property?
I have a solution but it's pretty ugly, and it accounts just for this two cases, I was wondering if there is something more flexible I could do