The JavaScript Console API

Because the alert() days are long gone and all browsers are implementing almost the same console object methods, logging, debuging and testing is now way easier.
Let's look at some methods of console's API, grouped by their intention. But first, let's have something to play with:
const d = new Date(2040, 12, 17);
const weekDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];

// *day* will be reused below
const day = weekDays[d.getDay()];
Logging, the most used scenario:
console.log(`Day name is ${day}`);
// => Day name is Friday

console.info(`Just so you know, the day name is ${day}`);
// => Just so you know, the day name is Friday
If you want included stack trace, then console.warn or console.error will do that for you. Just click the ► icon to expand. You can also use console.trace if you want it at desired location in your code:
console.warn(`Uh, oh! Today is ${day} 😱`);
// => ► Uh, oh! Today is Friday 😱

console.error('Something went wrong. 🧨');
// => ► Something went wrong. 🧨

console.trace(day);
// Will return the ► trace expanded
One of my favourite is console.dir
const car = {
  colour: 'blue',
  gearbox: 'automatic',
  engine: {
    fuel: 'petrol',
    cylinders: 6
  },
  seats: 4,
  extras: ['live tracking', 'extended waranty']
}

console.dir(car);
/* =>
▾Object
  colour: "blue"
  ▾engine:
    cylinders: 6
    fuel: "petrol"
    ►__proto__: Object
  ▾extras: Array(2)
    0: "live tracking"
    1: "extended waranty"
    length: 2
    ►__proto__: Array(0)
  gearbox: "automatic"
  seats: 4
  ►__proto__: Object
*/
Let's also give console.table a go:
const todo = ['call Jane', 'send reports', 'book holiday'];

console.table(todo)
/* =>
(index)         Value
0               "call Jane"
1               "send reports"
2               "book holiday"
▾Array(3)
  0: "call Jane"
  1: "send reports"
  2: "book holiday"
  length: 3
  ►__proto__: Array(0
*/
There's also:
console.clear(); // => will clear the console
console.debug('Something'); // => Currently a console.log alias
Grouping console messages, useful when intensive logging is performed:
console.group('Grouped messages'); // start group
console.log('This is a log.');
console.info('This is an info.');
console.groupEnd(); // close group
/* =>
▾Grouped messages
  This is a log.
  This is an info.
*/
Timing has never been easier with console.time:
console.time('DATA_FETCH');
fetch('https://jsonplaceholder.typicode.com/posts')
  .then(raw => raw.json())
  .then(data => console.log(data));
console.timeEnd('DATA_FETCH');
/* =>
DATA_FETCH: 0.399169921875ms
(100) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, ... ]
*/
Perform testing via console.assert(test, response)
console.assert(66 == '66', '66 not == to "66"');
// because test has passed (66=='66'), nothing will be logged

console.assert(66 === '66', '66 not === to "66"');
// => ►Assertion failed: 66 not === to "66"