4.7.2. Compound Assignment Operators¶
/*A common programming task is to update the value of a variable in
reference to itself.*/
let x = 1;
x = x + 1;
console.log(x);
//2
4.7.2. Compound Assignment Operators¶
/*A common programming task is to update the value of a variable in
reference to itself.*/
let x = 1;
x = x + 1;
console.log(x);
//2
4.7.2. Compound Assignment Operators¶
/*This action is so common, in fact, that it has a shorthand operator,
+=. The following example has the same behavior as the one above.*/
let x = 1;
x += 1;
console.log(x);
//2
4.7.2. Compound Assignment Operators¶
/*A common programming task is to update the value of a variable in
reference to itself.*/
let x = 1;
x = x + 1;
console.log(x);
//2
4.7.2. Compound Assignment Operators¶
/*This action is so common, in fact, that it has a shorthand operator,
+=. The following example has the same behavior as the one above.*/
let x = 1;
x += 1;
console.log(x);
//2
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us