Let’s say you had a string with a simple message on it.
var greeting = 'Hello, world!';
You want to add, “How are you today?” to the end of it. You might do something like this.
greeting = greeting + ' How are you today?';
This adds whatever string you place after it to the existing string. Here’s that same task written with
greeting += ' How are you today?';
You can also use this approach with numbers.
var num = 100; // num now equals 142 num += 42;
You can also use it to subtract values from numbers.
// num now equals 122 num -= 20;