Dump (and pretty print) all function arguments to the console

in code

A Lodash-infused variant of this function is my lifeline at work (ALL the ES6 syntaxes!):

function dump() {
    [...arguments].forEach(arg => {
        console.log(JSON.stringify(arg, null, '\t'));

For example:

  { messages: { hello: 'World!', goodbye: 'Moon!' } },
  ['Apples', 'Oranges', 'Peaches', 'Pears']

  "messages": {
    "hello": "World!",
    "goodbye": "Moon!"


Six Months in the Mountain Kingdom

in me

Your email address will not be published. Required fields are marked *