Fantastic library to easily get to nested properties of objects in JavaScript(github.com)2 points·by softinio·11년 전·1 commentsgithub.comFantastic library to easily get to nested properties of objects in JavaScripthttps://github.com/d10n/drilldown1 commentsPost comment[–]pablovidal85·11년 전reply Object.prototype.get = function(k, d){ return k.split(".").reduce(function(a, b){ return a ? b in a && a[b] || d : a }, this) }; // ({}).get('a.b.c', null) === null // ({a:{b:{c:2}}}).get('a.b.c') === 2