Last active
December 28, 2015 06:39
-
-
Save twmulloy/eb3ed4629217ebbfedf6 to your computer and use it in GitHub Desktop.
verbose js example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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