Prototype: KeyValueStore.set(key,value) returns undefined, get returns string/null, delete returns bool. Keys/values are strings, empty allowed; stored values never null. Deleting/recreating is valid.
Final: TransactionalStore adds begin/commit/rollback/depth, returning integer depth. Close only the innermost frame; commit merges into parent, rollback discards it. At depth zero commit/rollback raise RangeError unchanged. Reads see all innermost writes/deletions. snapshot(prefix="") returns a fresh plain object filtered by exact prefix and constructed in lexical key order. JavaScript enumeration places integer-index property names first by language rules; the snapshot follows that standard behavior. An empty prefix includes all keys.
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.
Complete the starter code, then run the checks.
Results and errors will appear here.