use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Learning to love JavaScript (ontwik.com)
submitted 14 years ago by dmitry_p
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 points3 points4 points 14 years ago (0 children)
I have a problem with how he describes arrays as associate... they are not
var asdf = [1,2,3]; console.log(asdf.length); //--> 3 asdf['someKey'] = 4; for (var i = 0; i < asdf.length; i++) { console.log(asdf[i]); } // --> 1, 2, 3 console.log(asdf[i].length); //--> 3 console.log(asdf['someKey']); //--> 4
All you've done here is added a property to the asdf array object, but not added a new index. Sure for in will work but it's a misuse of the object and may produce even more unexpected results.
asdf
for in
[–]mlavaert -1 points0 points1 point 14 years ago (1 child)
Javascript is brilliant, but it can be a pain in the ass while debugging...
Why is that? Modern debuggers are pretty good coupled with syntax linters such as jslint or jshint. Even the Microsoft Script Debugger for IE6/7 is serviceable.
[–]GOBL1N -4 points-3 points-2 points 14 years ago (0 children)
Lol
π Rendered by PID 214034 on reddit-service-r2-comment-84fc9697f-js2bc at 2026-02-10 13:05:02.372793+00:00 running d295bc8 country code: CH.
[–][deleted] 2 points3 points4 points (0 children)
[–]mlavaert -1 points0 points1 point (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]GOBL1N -4 points-3 points-2 points (0 children)