Public
Edited
Apr 25, 2023
Insert cell
Insert cell
Insert cell
Insert cell
myArray = [1,2,3,4,5,6,7,8,9,10]
Insert cell
Insert cell
myArray.map(d => d*10)/// ... use map() to achieve the above result
Insert cell
Insert cell
myArray.filter(d => d<=4)/// ... use filter() to achieve the above result
Insert cell
Insert cell
Insert cell
import {myDataset} from "@datavisufs/js-and-observable-syntax"; // ... import the `myDataset` cell from the previous notebook as the 'ages' cell of this notebook
Insert cell
Insert cell
myDataset // ...
Insert cell
Insert cell
Inputs.table(myDataset)// ... you can use Inputs.table()
Insert cell
Insert cell
myDataset.map(d => d.name)// ... map() can do the trick
Insert cell
Insert cell
myDataset.filter((d) => d.name === "Gandalf" )
Insert cell
myDataset.map((d)=> d.name ==="Gandalf") // what would happen if you were to use `map()` instead of `filter()`? Try and find out.
Insert cell
Insert cell
myDataset.filter((d) => d.age > 20000)// ... filter() could help here
Insert cell
Insert cell
myDataset.filter((d) => d.age < 1000) // ...
Insert cell
Insert cell
Insert cell
import {imageToDo} from "@clokman/student-blocks"
Insert cell
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