Skip to content

Instantly share code, notes, and snippets.

@dev-alihasan
Created November 12, 2023 14:47
Show Gist options
  • Save dev-alihasan/806db07040ef92d4c84d57b84667d2dd to your computer and use it in GitHub Desktop.
Save dev-alihasan/806db07040ef92d4c84d57b84667d2dd to your computer and use it in GitHub Desktop.
console.log("printing masage to the consloe");
console.warn("Issuing a warning massage");
console.error("Oops! Something went wrong.");
console.info('providing information')
let a = 5;
console.assert(a === 10, "a is not equal to 10")
console.count("Function Call");
console.count("Function Call");
console.countReset("Function Call")
// Start the timer
console.time("Array Sorting");
// Simulate sorting an array (for demonstration purposes)
const numbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5];
numbers.sort();
// Log an intermediate time (optional)
console.timeLog("Array Sorting");
// Continue some other work
console.log("Array sorted!");
// Log another intermediate time (optional)
console.timeLog("Array Sorting");
// End the timer and display the total time
console.timeEnd("Array Sorting");
console.group("Group A");
console.log("Message 1");
console.log("Message 2");
console.groupEnd();
console.group("Group B");
console.log("Message 3");
console.groupEnd();
const data = [
{ name: "Alice", age: 25 },
{ name: "Bob", age: 30 },
{ name: "Charlie", age: 22 }
];
console.table(data);
console.log("This message will be cleared.");
console.clear();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment