Prototype: RecordStore.set(key,field,value), get, and scan(key,prefix="") store arbitrary strings including empty values; set returns undefined, missing get null, scan fresh [field,value] pairs sorted by field name. Records/instances independent.

Final: TemporalDatabase methods take nonnegative nondecreasing safe-integer ts; valid reads/failed conditionals also advance accepted time, equal timestamps allowed. set(ts,key,field,value,ttl=null) writes on [ts,ts+ttl), positive integer TTL or null for forever. get reads current; delete appends absence only if visible. compareAndSet validates TTL even on mismatch, compares exact expected string, and replaces value/lifetime only on success. scan(ts,key,prefix="") returns sorted visible pairs. getAt(ts,key,field,at) requires integer 0<=at<=ts and queries processed history. Invalid TTL/lookback/time preserves both history and accepted clock. An expired newer version never exposes an older one.

Every class is exported by name from exercise.mjs. Keep instances independent. Unless explicitly documented otherwise, input values have the stated collection/string types and do not contain null elements. Invalid calls preserve state; validate before mutation. Return fresh mutable snapshots unless stated otherwise.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.