Skip to content

Instantly share code, notes, and snippets.

View whatisboom's full-sized avatar

Brandon Jernigan whatisboom

View GitHub Profile
@letsgetrandy
letsgetrandy / brototype.js
Last active February 1, 2019 17:52
Bro, do you even?
if (Object.defineProperty) {
Object.defineProperty(Object.prototype, 'doYouEven', {
value: function(key) {
var props = (key || '').split('.'),
item = this;
for (var i=0; i<props.length; i++) {
item = item[props[i]];
if (typeof item === 'undefined') return false;
}
return true;