Language concepts

Referential transparency

Try the free JavaScript compiler

Reasoning principle that an expression can be replaced by its value without changing observable behavior. JavaScript object identity complicates replacement of fresh object results.

Formal Syntax & Structure

javascript syntaxjavascript
f(3) → equivalent result

Working Example

Example Snippetjavascript
const f=n=>n+2;console.log(f(3)*2,5*2);
JavaScript Reference