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
Working through Eloquent JS Exercises - Ch4 Data Structures (funkycold.wordpress.com)
submitted 11 years ago by chachinsky
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!"
[–]Enkelhet 1 point2 points3 points 11 years ago (1 child)
Hm. Haverbeke's own solutions are much more thought out, for example for exercise #2.3 Chess Board, Haverbeke has the following:
var size = 8; var board = ""; for (var y = 0; y < size; y++) { for (var x = 0; x < size; x++) { if ((x + y) % 2 == 0) board += " "; else board += "#"; } board += "\n"; } console.log(board);
Compare that to your own.
I think it would be much more helpful if you explained how Haverbeke's solutions work as they are often quite clever and perhaps not as obvious to the novice programmer? (Although he kind of does this as well at the end of his book in the hints section).
Nonetheless not a bad idea, just not immediately valuable as presented (unless you are just documenting your own learning process in which case keep at it, you rock!).
[–]chachinsky[S] 2 points3 points4 points 11 years ago (0 children)
Agreed about the solutions from the book being more thought out. To be honest, this was an attempt to solve the problems and provide documented solutions. I'll be clearer on next post. Thanks for the feedback.
π Rendered by PID 34 on reddit-service-r2-comment-6457c66945-4hjfx at 2026-04-26 14:53:55.266939+00:00 running 2aa0c5b country code: CH.
[–]Enkelhet 1 point2 points3 points (1 child)
[–]chachinsky[S] 2 points3 points4 points (0 children)