Archive for July 6, 2007

Favorite Recent Links

Posted in JavaScript, Web on July 6, 2007 by Joey

My favorite recent links I have found:

Software Engineering Proverbs

I liked:

  • If you make a general statement, a programmer says, ‘Yes, but…’ while a designer says, ‘Yes, and...’
  • One test is worth a thousand opinions.
  • If you think good architecture is expensive, try bad architecture

CodeIDE
Useful for running quick JavaScript tests

Windows XP Tips and Tricks
Skaters that rule at Basketball

JavaScript Decrement Operator

Posted in JavaScript, programming on July 6, 2007 by Joey

The JavaScript decrement operator subtracts one from it’s operand. The decrement operator can be used either as a prefix or a postfix:

var x = 1;
y = --x; //Prefix; y is 0
document.write(y);

var x = 1;
y = x--; //Postfix; y is 1
document.write(y);

As seen in the previous example, when the decrement operator is applied to a variable prior to the variable evaluation, the variable has the decremented value when evaluated. If the decrement operator is applied to a variable after the variable evaluation, the variable is evaluated with the value it contains before it is decremented.

The decrement property can be applied on a variable, an array element or a property of an object.

Related articles:
JavaScript Increment Operator