mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
* Expand static Effect support across common APIs * Preserve compiler parity across expanded Effect patterns * Fix compiler regressions exposed by Effect coverage * Bound shared type conversion traversal * Clarify conversion contracts and tidy fixtures * Run every Effect fixture in CI shards * Preserve inferred array assignments in concurrent Effect programs * Record inferred array fixture compiler ordering
22 lines
465 B
JavaScript
22 lines
465 B
JavaScript
class Queue {
|
|
head = { value: 0, next: null };
|
|
tail = this.head;
|
|
append(value) {
|
|
this.tail.next = { value, next: null };
|
|
this.tail = this.tail.next;
|
|
}
|
|
values() {
|
|
const result = [];
|
|
let current = this.head.next;
|
|
while (current !== null) {
|
|
result.push(current.value);
|
|
current = current.next;
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
const queue = new Queue();
|
|
queue.append(20);
|
|
queue.append(22);
|
|
console.log(queue.values().join(","));
|