underscore arrays
for practice
Babel + JSX
let _ = {
// returns first element or first n(excluding) elements
keys(obj) {
return Object.keys(obj);
},
values(obj) {
return Object.values(obj);
},
allKeys(obj) {
return Object.prototype;
}
};
console.log(_.keys({"one": 1, "two": 2, "three": 3}));
console.log(_.values({"one": 1, "two": 2, "three": 3}));
function Stooge(name) {
this.name = name;
}
Stooge.prototype.silly = true;
console.log(_.allKeys(new Stooge("Poonam")));