Public
Edited
Jun 28, 2023
Insert cell
Insert cell
data = [
[ { "firstName" : "John", "lastName" : "Doe", "age" : 23 },
{ "firstName" : "Jane", "lastName" : "Doe", "age" : 25 }],
[ { "firstName" : "Dave", "lastName" : "Doe", "age" : 22 },
{ "firstName" : "Cindy", "lastName" : "Doe", "age" : 35 }]
]
Insert cell
Insert cell
data_filtered = data.map(dataset => dataset.filter( row=> {return row.firstName ==="John" }))
Insert cell
Insert cell
data_map = data.map(dataset => dataset.filter( row=> {return row.firstName ==="John" }))
Insert cell
Insert cell
data_forEach = data.forEach(dataset => dataset.filter( row=> {return row.firstName ==="John" }))
Insert cell
data_forEach_fixed =
{
let arr = []
data.forEach(dataset => dataset.filter( row=> {if(row.firstName ==="John") arr.push(row)}))
return arr
}
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