Tuesday, June 23, 2009

Javascript Best Practices 2

Always, Always Use Semicolons.

If you not use ;(semicolon) in the code, it's very difficult to find the error.

So please try to use everystatement with semi colon.

var someItem = 'some string'
function doSomething() {
return 'something'
}

Better

var someItem = 'some string';
function doSomething() {
return 'something';
}