v1
- by mydea 6/17/202500
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const size = 300;
const buckets = new Array(size).fill(undefined);

// Fill some random things in
buckets[5] = { timestampInS: 5, spans: new Set(new Array(10).fill(undefined).map((_, i) => ({ val: i }))) };
buckets[55] = { timestampInS: 55, spans: new Set(new Array(1000).fill(undefined).map((_, i) => ({ val: i }))) };
buckets[105] = { timestampInS: 105, spans: new Set(new Array(500).fill(undefined).map((_, i) => ({ val: i }))) };
buckets[255] = { timestampInS: 255, spans: new Set(new Array(1000).fill(undefined).map((_, i) => ({ val: i }))) };
delete caserun single casemove downdrag and drop case


ready



const finishedSpans = buckets.flatMap(bucket =>
  bucket ? Array.from(bucket.spans) : [],
);
    
console.log(finishedSpans);
delete caserun single casemove updrag and drop case


ready



const finishedSpans = [];
for (const bucket of buckets) {
  if (bucket) {
    for (const span of bucket.spans) {
      finishedSpans.push(span);
    }
  }
}
    
console.log(finishedSpans);
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN