I have a funciton that accept a property name
func(propertyName) {
return object[propertyName];
}
so by calling func('value')
will return the object.value
However the object is complex, so it has inner props
What I want to do is to be able to do that func('property1.property2')
What is the best way to do that?