A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/operators/increment_and_decrement below:

increment and decrement ยท WebPlatform Docs

increment and decrement Summary

The increment operator increments, and the decrement operator decrements, the value of a variable by one.

Syntax
result = ++ variable

result = -- variable

result = variable ++

result = variable --
result
Any variable.
variable
Any variable.
Examples

See Remarks.

var k = 5;
var j;
j = ++k; 
j = k++; 
Remarks

If the operator appears before the variable, the value is modified before the expression is evaluated. If the operator appears after the variable, the value is modified after the expression is evaluated. In other words, given j = ++k; , the value of j is the original value of k plus one; given j = k++; , the value of j is the original value of k , which is incremented after its value is assigned to j.

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4