Skip to content
techsnow

Introduction

The Console

The console is your best friend while learning. Use it to print values and check what your code is doing.

console.log("Normal message");
console.warn("Something looks wrong");
console.error("Something broke!");
console.table([{ name: "Ali", marks: 85 }, { name: "Sara", marks: 92 }]);

console.log can print several values at once, separated by commas.

const name = "Ayesha";
const score = 42;
console.log("Name:", name, "Score:", score);

Output

Name: Ayesha Score: 42