Your path is an array of ['foo', 'bar', 'blablah'], so shifting removes 'foo' from the array. But you are trying to store your inputs at store['foo']['bar'], so doing store[path[0]] is trying to access an object at store['bar'] which doesn't exist.

Here is a working version

https://jsfiddle.net/j87m4z71/

Email codedump link for Dynamically scaffold a JavaScript Object based on a string path