Different syntax

I noticed that somewhere along the course, the syntax of the JavaScript changed. Is there a reason for this? Which one is better? More info on stack overflow here