Published
Edited
Apr 26, 2022
Insert cell
Insert cell
Insert cell
Insert cell
{
const a = 5;
const b = 6;
const c = a + b;
console.log(c);
}
Insert cell
Wir können dann in der Konsole den Wert von c ablesen. Wenn wir in der Konsole ein Objekt zurückgeben, haben wir zudem noch eine genauere Angabe, was wir gerade geloggt haben.
Insert cell
{
const a = 5;
const b = 6;
const c = a + b;
console.log({ c });
}
Insert cell
Einen solchen Konsolen-Aufruf können wir einfach in unseren Code einbauen und dadurch nachvollziehen, was in einer gewissen Variable gerade für ein Wert gesetzt ist.

### Debugger
Mit einem Debugger können wir den Programm-Code anhalten bzw. sogenannte Breakpoints setzen. Das kann bei einem komplexen Funktionsaufruf oder auch einer Schleife sinnvoll sein.
Insert cell
{
const length = 5;
let sum = 0;
for (let index = 0; index < length; ++index) {
sum += 5;
debugger;
}
}
Insert cell
Insert cell
FileAttachment("inspect_data.gif").image()
Insert cell
Insert cell
Insert cell
import {style} from "@cas-datenvisualisierung/style"
Insert cell
style
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more