Skip to content

Commit

Permalink
Object.keys polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed May 20, 2015
1 parent d74ac8c commit 6bef69b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@
}
}());
}

if (!Object.keys) {
Object.keys = function (
o, // object
k, // key
r // result array
){
// initialize object and result
r=[];
// iterate over object keys
for (k in o)
// fill result array with non-prototypical keys
r.hasOwnProperty.call(o, k) && r.push(k);
// return result
return r
};
}
//</editor-fold>

// Case insensitive contains search
Expand Down

0 comments on commit 6bef69b

Please sign in to comment.