From 24a911188070c4e25b6dbadb1f04e3f1bb09b4ed Mon Sep 17 00:00:00 2001 From: Alexander Ott Date: Sun, 28 Oct 2018 16:19:02 +0100 Subject: [PATCH] add more console-hacks --- console.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/console.js b/console.js index d381020..d5f3a0b 100644 --- a/console.js +++ b/console.js @@ -26,8 +26,10 @@ const foo = { name: 'tom', age: '20', available: 'yes' } const bar = { name: 'dick', age: '23', available: 'no' } const baz = { name: 'harry', age: '26', available: 'no' } -console.log({ foo, bar, baz }); +// Creates an array with all previously created objects +const objArr = [foo, bar, baz] +console.log({ foo, bar, baz }); // Printing the above objects with some cool heading console.log('%c Objects with name', 'color: blue'); @@ -65,6 +67,9 @@ console.error('Looks likes you did somehing wrong :('); console.assert(false,"This is a false assertion"); console.assert(true,"This is a true assertion"); +// Displays the objects as table with the array indexes +console.table(objArr) + // Using console to print an image console.log('%c' + 'Hello Console!', '\ font-size: 3em; \