Language concepts

Stale-result guard

Try the free JavaScript compiler

Application technique associating a response with the request identity current at initiation. Reject stale commits even when the operation cannot be canceled.

Formal Syntax & Structure

javascript syntaxjavascript
if (id === latestId) commit(value);

Working Example

Example Snippetjavascript
let latest = 0;function start() { const id = ++latest; return value => { if (id === latest) console.log(value); }; }const first = start(); const second = start();second("new"); first("old");
JavaScript Reference