40

Did you know that
console.table(arr);
will let you print whole JavaScript arrays in table form in console?

Comments
  • 8
  • 6
    Also this: console.log({obj}) print the object's key
  • 1
  • 0
    No interesting
  • 18
    Good read, always remember kids , when you find something here that’s already known to you , there might be some junior Dev who will be happy that he found this and can use it.

    P.S. I didn’t know this , not ashamed
  • 3
    As a non-dev, I appreciate this kind of small tips.
    I only knew console.log until this point and never even thought about other options.

    Thank you for sharing.
  • 3
    In fact there are are lots of fun stuff you can do with the console object. Like error, info, warn, dir, time, and so on. There's also %c which allows you to style the outputs with css :3
  • 3
    I haven't explored the console object as much as I should. Thanks for the extra bit.
  • 1
  • 3
    console.group()is something I use way more often but other people never seem to know it.
Add Comment