frankyonnetti
12/23/2013 - 2:47 PM

#jquery Variable increments

jQuery - variable increments #jquery

// Use variable += value; to increment by more than one:
v += 4;

// It works with other operators too:
v -= 4;
v *= 4;
v /= 4;
v %= 4;
v ||= 4;
v &&= 4;

// Using ||= is good for setting default values for variables that are null/undefined/empty/zero.