I am learning Javascript from CrockFord video "Crockford on javascript" and I am watching : "Function The Ultimate" In one of his code "he was talking about " pseudo parameters" " I saw something like this :
for( i = 0; i<n; i+=1) So why he is not using the increment operator "++" and he is using the "+=", i know they do the same but is there a performance difference ?
Thank you.
++is plus 1 and+=can be plus X. In your instance they both do the same thing since you are adding by only 1. edit: should have read the end part of the question..I can't speak on performance difference, but I would imagine not muchi = i + 1==i += 1==i ++==++ i(although what each of those returns when used inside a larger expression is another matter)++for some reason: see stackoverflow.com/questions/971312/…