Closed TodePond closed 2 years ago
Maybe it would be better to have a keying function, then it could be used with regular maps instead.
const grid = new Map()
grid.set(key([2, 3]), "foo")
grid.get(key([2, 3])) //"foo"
Or something funky like...
const grid = new Map()
grid.set(_([2, 3]), "foo")
grid.get(_([2, 3])) //"foo"
Or maybe...
const grid = new Map()
grid.set(tuple([2, 3]), "foo")
grid.get(tuple([2, 3])) //"foo"
json.js now covers this
One day the tuple proposal might arrive and replace this. (https://github.com/tc39/proposal-record-tuple)