What does this shared-memory code print?

from Processes and threads
Node 24 beginner 3 min

What does this shared-memory code print?

JavaScript
const bytes = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
const counter = new Int32Array(bytes);
Atomics.store(counter, 0, 2);
const previous = Atomics.add(counter, 0, 3);
console.log(previous, Atomics.load(counter, 0));
Open in playground
Report an error