Dynamically create nested level groups by properties in Javascript Code /** * Creates nested groups by object properties. * `properties` array nest from highest(index = 0) to lowest level. * * @param {String[]} properties * @returns {Object}