Method getRow documentation
Returns the first object matching the given filter in an array of objects.
Example
```javascript
let ar = [
{name: "Raiders of the lost ark", director: "Steven Spielberg", year: 1981, id: 589},
{name: "Goonies", director: "Richard Donner", year: 1985, id: 689},
{name: "Star wars", director: "George Lucas", year: 1977, id: 256},
{name: "Jaws", director: "Steven Spielberg", year: 1975, id: 423}
];
bbn.fn.getRow(ar, {director: "Steven Spielberg"});
// {name: "Raiders of the lost ark", director: "Steven Spielberg", year: 1981, id: 589},
bbn.fn.getRow(ar, "director", "Steven Spielberg");
// Same result as the previous example
bbn.fn.getRow(ar, {
logic: "OR",
conditions: [
{
field: "director",
value: "Richard Donner"
}, {
field: "director",
value: "George Lucas"
}
]
);
// {name: "Goonies", director: "Richard Donner", year: 1985, id: 689},
```
Returns the first object matching the given filter in an array of objects. - The filtering arguments follow the same scheme as bbn.fn.search.
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2024
BBN Solutions