Created
November 18, 2013 22:03
-
-
Save brumm/7536211 to your computer and use it in GitHub Desktop.
Effortlessly log values without having to wrap your code in console.log() calls, by logging the value, and returning it, allowing for chaining
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
Object.defineProperty(Object.prototype, '_log_', { | |
get: function() { | |
"use strict"; | |
console.log(this); | |
return this; | |
}, | |
enumerable: false | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment