Skip to content

Instantly share code, notes, and snippets.

@twmulloy
Last active December 28, 2015 06:39
Show Gist options
  • Save twmulloy/eb3ed4629217ebbfedf6 to your computer and use it in GitHub Desktop.
Save twmulloy/eb3ed4629217ebbfedf6 to your computer and use it in GitHub Desktop.
verbose js example
var k = (function(){
"use strict"
var what, is;
what = {
type: {
is: function (obj) {
var type = Object.prototype.toString.call(obj);
return type.substr(8, type.length - 9).toLowerCase();
}
}
};
function is (obj) {
return {
array: function (obj) {
return what.type.is(obj) === "array";
},
object: function (obj) {
return what.type.is(obj) === "object";
},
string: function (obj) {
return what.type.is(obj) === "string";
}
};
}
function merge () {
}
Object.prototype.k = function (opts) {
// console.log(
// what.type.is(this),
// is(this).string,
// is(this).object,
// is(this).array
// );
console.log(this, is);
this["is"] = is();
console.log(this.is.string);
};
return {};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment