Good day! I wanted to simplify work with input when forming a multi-level object, to be sent to the server. The idea was simple, input names set such that would correspond to the keys of a multi-level object. For example: <input name="price.now"> <input name="price.past"> <input name="price.past.first"> , etc. I asked the appropriate question. Synchronize input with a multi-level object . But as it turned out, there are no standard methods for such an implementation. I tried to write my own universal function for the implementation of our plans. It seems to have happened.
See the answer - point out the shortcomings of my code, and also suggest your options for implementation.