Tsallaka zuwa abun ciki
Justice Tech School

console Methods

console has log, error, warn, table, dir, group, time and assert.

Example
console.log("info");
console.table([{ a: 1, b: 2 }, { a: 3, b: 4 }]);
console.group("Group");
console.log("inside");
console.groupEnd();
console.assert(1 === 1, "ok");

Result

info
┌─────────┬───┬───┐
│ (index) │ a │ b │
├─────────┼───┼───┤
│ 0       │ 1 │ 2 │
│ 1       │ 3 │ 4 │
└─────────┴───┴───┘
Group
  inside

Exercise

Show rows as a table.

console.(rows)

Quiz Test

Which writes to stderr?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.