24 lines
476 B
JavaScript
24 lines
476 B
JavaScript
import { Row_Based_Table } from '@efforting.tech/table'
|
|
|
|
|
|
const t = new Row_Based_Table({ column_names: 'SKU, Quantity, Price' });
|
|
|
|
//console.log(t.column_names_lut); /* { SKU: 0, Quantity: 1, Price: 2 } */
|
|
|
|
t.push_rows(
|
|
['VOLVO-1', 3, 120_000],
|
|
['VOLVO-2', 4, 140_000],
|
|
)
|
|
|
|
const [A] = t.read_rows(0);
|
|
const [B] = t.snapshot_rows(1);
|
|
|
|
console.log(A.value);
|
|
console.log(B.value);
|
|
A.update({Quantity: 5});
|
|
console.log(A.value);
|
|
|
|
for (const r of t) {
|
|
console.log(r.object);
|
|
}
|