Operators

Decrement postfix

Try the free JavaScript compiler

Subtracts one after numeric conversion, writes the decreased result and yields the prior numeric value. An ordinary read-only binding cannot be updated.

Formal Syntax & Structure

javascript syntaxjavascript
target--

Parameters & Attributes

NameTypeDescription
targetassignment targetWritable binding or property.

Return Value

Number or BigInt

New numeric value for prefix; previous numeric value for postfix.

Working Example

Example Snippetjavascript
let n = 3;console.log(n--, n);
JavaScript Reference