Added
Object.keys. Removed String.prototype.*, alert, and waitUntil.
"use strict";
if (typeof Object.create !== "function") {
Object.create = function (o) {
function F() {}
F.prototype = o;
return new F();
};
}
if (typeof Object.keys !== "function") {
Object.keys = function (obj) {
var name, output = [];
for (name in obj) {
if (Object.prototype.hasOwnProperty.call(obj, name)) {
output.push(name);
}
}
return output;
};
}
The above are functions I have found indispensable or extremely useful in my programming. They are listed here for convenience.
Object.create
No comments:
Post a Comment