Skip to content

Instantly share code, notes, and snippets.

@brumm
Created November 18, 2013 22:03
Show Gist options
  • Save brumm/7536211 to your computer and use it in GitHub Desktop.
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
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