Skip to content

Instantly share code, notes, and snippets.

@coderwurst
Created March 3, 2020 07:37
Show Gist options
  • Save coderwurst/2dab3d8ceffc1d905fc9eb4d6197bbae to your computer and use it in GitHub Desktop.
Save coderwurst/2dab3d8ceffc1d905fc9eb4d6197bbae to your computer and use it in GitHub Desktop.
// see all console functions
console.log(console);
// 1 view data as table console.table(data, columnNames)
const array = [1, 2, 3, 4, 5];
const object = {
name: "Leira",
lastName: "Sánchez",
twitter: "MechEngSanchez",
};
console.table(array)
console.table(object);
// 2 count to determine how many times a method has been called
let dev = '';
const followMe = (dev) => {
console.count('followers');
return `${dev} is following you`;
}
followMe('John'); // followers: 1
followMe('Karen'); // followers: 2
followMe('Camila'); // followers: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment