Skip to content

Instantly share code, notes, and snippets.

@techwraith
Forked from larzconwell/gist:3138289
Created July 18, 2012 19:32
Show Gist options
  • Save techwraith/3138306 to your computer and use it in GitHub Desktop.
Save techwraith/3138306 to your computer and use it in GitHub Desktop.
this.toObj = function () {
var obj = {};
for (var p in this) {
// For some reason if this has more than one if statement
// or if the if is checking more than one thing via "||" it
// completely ignores it and assumes it's true
if ( (typeof this[p] != 'function') && p != 'adapter' && p != 'type') {
obj[p] = this[p];
}
}
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment