bhylu.com

Advertisements

Debug Console

Log useful context with a value. Objects can make related fields easier to inspect than an unexplained number.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

const session = {title: "Repair club", places: 12};
console.log({stage: "before booking", ...session});

What happens

The log includes both the stage and the current fields.