Skip to content

Instantly share code, notes, and snippets.

@afshinm
afshinm / gist:4733756
Last active December 12, 2015 06:59 — forked from arashmilani/gist:4732488
function assertType(obj, type) {
return obj.constructor.name === type.name
}
Object.prototype.assertType = function(type) {
return this.constructor.name === type.name
}
//Preparing test, mock objects
function Book(){};