bhylu.com

Advertisements

JS Assignment

Assignment stores a value in a binding. Compound assignment reads the old value and writes a new one.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

let budget = 30;
budget -= 8;
budget += 5;
console.log(budget);

What happens

The remaining budget is 27.