Public
Edited
Sep 18, 2023
Insert cell
Insert cell
<table>
<thead>
<tr><th>Input 1</th><th>Input 2</th><th>Result</th></tr>
</thead>
<tbody>
<tr><td>${viewof input1}</td><td>${viewof input2}</td><td>${concat2([viewof input1, viewof input2])}</td></tr>
</tbody>
</table>
Insert cell
concat2 = (views) => {
const output = htl.html`<span>`;
const update = () => {
output.textContent = views.map((v) => v.value).join("");
};
for (const view of views) {
view.addEventListener("input", update);
invalidation.then(() => view.removeEventListener("input", update));
}
update();
return output;
}
Insert cell
viewof concat = input1 + input2
Insert cell
viewof input1 = Inputs.text({ value: "foo" })
Insert cell
viewof input2 = Inputs.text({ value: "bar" })
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