Platform
Resources
Pricing
Sign in
Get started
Mila Frerichs
Workspace
Fork
Published
By
Mila Frerichs
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.
Try it for free
Learn more
Fork
View
Export
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
findbyKey
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML