Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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; \
Expand Down