How to get and to update nested object values with the dot notation string using javascript