hasTableCell
The hasTableCell
method returns a boolean indicating whether a given Cell
exists anywhere in a Table
, not just in a specific Row
.
hasTableCell(
tableId: string,
cellId: string,
): boolean
Type | Description | |
---|---|---|
tableId | string | |
cellId | string | |
returns | boolean |
Example
This example shows two simple Cell
existence checks.
import {createStore} from 'tinybase';
const store = createStore().setTables({
pets: {fido: {species: 'dog'}, felix: {legs: 4}},
});
console.log(store.hasTableCell('pets', 'species'));
// -> true
console.log(store.hasTableCell('pets', 'legs'));
// -> true
console.log(store.hasTableCell('pets', 'color'));
// -> false
Since
v3.3.0