Skip to content

Instantly share code, notes, and snippets.

@larzconwell
Created July 18, 2012 19:29
Show Gist options
  • Save larzconwell/3138289 to your computer and use it in GitHub Desktop.
Save larzconwell/3138289 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') {
obj[p] = this[p];
}
}
return obj;
}
@mde
Copy link

mde commented Jul 18, 2012

Could you put your non-working example in there, commented out?

@larzconwell
Copy link
Author

We got it working Matthew, check https://gist.github.com/3138306 (:

@mde
Copy link

mde commented Jul 18, 2012

Excellent. :)

@larzconwell
Copy link
Author

Generators are completely done by the way ((: Well I'm going to add something Daniel suggested then it'll be done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment