code: function set(obj, path, value) {
  	const len = path.length - 1;
  	let node = obj;
  	for (let i = 0; i < len; i++) {
  		if (node[path[i]] == undefined) {
  			if (Number.isInteger(path[i + 1])) {
  				node[path[i]] = [];
  			} else {
  				node[path[i]] = {};
  			}
  		}
  		node = node[path[i]];
  	}
  	node[path[len]] = value;
  }
docs: const set = require("lodash.set");