Increment variable by more than 1?

increment, javascript

Solution

Use a compound assignment operator:

v += 4;

Problem

Here's my script : ``` function itemQuantityHandler(operation, cart_item) { var v = cart_item.quantity; //add one if (operation === 'add' && v < settings.productBuyLimit) { v++; } //substract one if (operation === 'subtract' && v > 1) { v--; } //update quantity in shopping cart $('.item-quantity').text(v); //save new quantity to cart cart_item.quantity = v; } ``` What I need is to increase `v` (`cart_item.quantity`) by more than one. Here, it's using `v++`, but it's only increasing by 1. How can I change this to make it increase by 4 every time I click on the plus icon? I tried ``` v++ +4 ``` But it's not working.

Original source