Published
Edited
May 10, 2019
Importers
Insert cell
md`# Find in Array By Key
Given a array of data you want to find the dataset in the array that is equal to some value.
\`\`\`[{key: 'SD'}]\`\`\`
You want to find the entry with key SD.
`
Insert cell
function findbyKey(d, dataProperty, property) {
const entries = d.filter((e) => e[dataProperty] === property);
return entries[0];
}
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