Skip to content

Instantly share code, notes, and snippets.

Created Jun 13, 2014
What would you like to do?
Object Prototype
Object.defineProperty(Object.prototype, "getDotNotated", {
value: function (dotNotation) {
var arrayOfNames = dotNotation.split('.');
var tmp = this;
for (var i in arrayOfNames) {
if (arrayOfNames.hasOwnProperty(i)) {
tmp = tmp[arrayOfNames[i]];
return tmp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment