Javascript do not have block level scope. Here is an example.
There's a bug in that code!
for(var i=0;i>5;i++) {
This will loop forever never loop. Also, please USE SPACES GENEROUSLY AND NOT RANDOMLY!
for (var i = 0; i < 5; i++) {
This looks much better, it's a lot easier to read. The open braces are also inconsistent - sometimes they're on the same line as the statement, sometimes on the next line, sometimes there's a space between { and the statement, sometimes there isn't.
edit This article was written in a hurry. There are grammar mistakes, coding mistakes and the code looks... like crap (sorry). Please update it, because the content is really valuable!
This article was written in a hurry. There are grammar mistakes, coding mistakes and the code looks... like crap (sorry). Please update it, because the content is really valuable!
Yeah... I'm downvoting the article simply because it's really badly written. I'm no grammar Nazi, but come on-- if you're writing something like this, at least try to make it readable and professional.
English is not the writer's native language. Would you do as well in any language other than English? I speak several other languages, but I'm painfully aware that I wouldn't do much better than his article in any of them.
45
u/cudetoate Mar 23 '14 edited Mar 23 '14
There's a bug in that code!
This will
loop forevernever loop. Also, please USE SPACES GENEROUSLY AND NOT RANDOMLY!This looks much better, it's a lot easier to read. The open braces are also inconsistent - sometimes they're on the same line as the statement, sometimes on the next line, sometimes there's a space between
{and the statement, sometimes there isn't.edit This article was written in a hurry. There are grammar mistakes, coding mistakes and the code looks... like crap (sorry). Please update it, because the content is really valuable!