get({foo: 4}, "foo") |
4 |
get({foo: 4}, "bar") |
undefined |
get([
{foo: "fooname"},
{bar: "barname"}
], "foo") |
["fooname", null] |
get([
{foo: "fooname"},
{bar: "barname"}
], "baz") |
[null, null] |
get([
{id: "foo", name: "fooname"},
{id: "bar", name: "barname"}
], "name") |
["fooname", "barname"] |
get({bar: [1,2,3]}, "*")
|
[1,2,3] |
get({foo: [1,2], bar:[3,4]}, "*")
|
[1,2,3,4] |
get({
bar: [
{foo: 1}, {foo: 2}, {foo: 3}
]
}, "*")
|
[{"foo": 1}, {"foo": 2}, {"foo": 3}] |
get({
bar: [
{foo: 1}, {foo: 2}, {foo: 3}
]
}, "bar.*.foo")
|
[1,2,3] |
get({
bar: [
{foo: 1}, {foo: 2}, {foo: 3}
]
}, "*.foo")
|
[null] |
get({
bar: [
{foo: 1}, {foo: 2}, {foo: 3}
]
}, "bar.*")
|
[{"foo": 1}, {"foo": 2}, {"foo": 3}] |
get([
{id: "foo", name: "fooname"},
{id: "bar", name: "barname"}
], ["id"]) |
["foo", "bar"] |
get({
bar: [{foo: 1}, {foo: 2}, {foo: 3}]
}, ["bar", "*", "foo"])
|
[1, 2, 3] |
get([1, 2, 3], 1) |
2 |
get([1, [2, 3]], 1) |
[2, 3] |
get({foo: true}, "foo == true") |
TypeError |
get({foo: true}, ["foo == true"]) |
undefined |