I'm pretty sure this is a common operation but I can't find a built-in way to take a part of JSON with specific keys. What I want to do is take some part of JSON with specific keys that I supply as an array. For example:
{
name: "Tim Cook",
age: 18,
id: 4
}
and an array: ["name", "id"]
to get
{
name:"Tim Cook",
id: 4
}