Created
December 1, 2014 03:25
-
-
Save mattbasta/1d51ec8be17102b61073 to your computer and use it in GitHub Desktop.
fix for every problem ever.js
This file contains hidden or 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
// Today: | |
var some_object = {'error': 'hey'}; | |
console.error('oh no blah blah ' + some_object); | |
// prints: oh no blah blah [object Object] | |
// But then debug: | |
Object.prototype.valueOf = function() {return JSON.stringify(this);}; | |
// then later | |
var some_object = {'error': 'hey'}; | |
console.error('oh no blah blah ' + some_object); | |
// prints: oh no blah blah {"error": "hey"} | |
// thank me laterrrrr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment