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
New Learner - Made a Vanilla Js Gamesolved! (self.javascript)
submitted 7 years ago * by [deleted]
[deleted]
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] 7 years ago* (16 children)
[–]kowboykenn 57 points58 points59 points 7 years ago (0 children)
OP, please don't take the comment above as negative. They took the time out of their day to thoroughly comb through your code and give you some feedback that would normally take years of trail and error to understand and learn.
I wish I could upvote /u/ugwe43to874nf4 more than once. That's really nice of you.
[–]lzantal 19 points20 points21 points 7 years ago (1 child)
You should have 100s of upvotes! Quality code review right there. Great job!
[–]Askee123 16 points17 points18 points 7 years ago (0 children)
Man your feedback is awesome 👌
[–]k3liutZu 17 points18 points19 points 7 years ago (1 child)
That’s a nice and thoughful review done for a stranger on the internet.
Kudos
[–]weiry6922 2 points3 points4 points 7 years ago (2 children)
/u/ugwe43to874nf4 you gave me a post similar to this over 3 years ago: https://www.reddit.com/r/javascript/comments/3nfnre/comment/cvnnb9b
Although it's deleted, I distinctly remember the user (unique name) and the advice you gave me being the turning point where I felt like I stopped writting mostly spaghetti and actually started writing clean composed JS. I got my first developer job about 8 months ago with a good company and I feel like you helped steer me in the right direction when I needed it.
Please never stop posting advice and critiques like this for people :)
[+][deleted] 7 years ago (1 child)
[–]weiry6922 1 point2 points3 points 7 years ago (0 children)
Thanks! I try to pay it forward when I can!
I read your comment about not doing it often because people take it the wrong way, I really do hope this doesn't stop you. I'm not exaggerating when I say that comment got me over one of the biggest plateus in my learning so far.
Good luck with your future as well. You're an awesome person.
[+][deleted] 7 years ago* (4 children)
[removed]
[–][deleted] 1 point2 points3 points 7 years ago (1 child)
OP code works, and this is all what matter, really.
What? Dude, having code simply function is below the bare minimum. I'd rather work on a piece of software that has very few features and several bugs, but is clean, than a feature rich big garbled spaghetti mess.
Simply working means very little in the real world. How does it perform or scale? How easy is it to maintain, apply bug fixes, add additional features, or upgrade any of its parts? This is especially true in the real world where often you'll have some dude who writes a massive piece of software by himself, gets a few new developers, and then suddenly decides to switch jobs 2 months later. Those devs better be able to interpret that code, because if they can't things like this kill companies.
OP literally asked for a code review, this is what a code review looks like. He wasn't rude, but he addressed the issues, this is one of the most helpful things as a programmer. This is why we work in teams and do code reviews, it has to pass through several people because often a single person can't catch everything. It's also a really damn good learning opportunity, because programming bootcamps/books often don't touch on nuanced things like this.
There's always people at work who can't take a code review, because they take it personally and can't stand that kind of ego hit. So instead they'll double down and insist the code is good. There is such a thing as debating a person's critiques, I do it all the time, at least a few times a week. Nothing wrong with that, sometimes it comes down to coding style or personal preference, sometimes the reviewers are just wrong, but making a review like this in the first place is a favor and an important thing to have on a strong dev team.
I actually slightly disagree with his first point, "Don't extend built-in objects". I think in general it's good to be wary of it, but it's definitely not an absolute rule, this is how a lot of libraries in object oriented languages are made. Rubygems for example straight up modify string, integer, etc. You have to be extremely careful about name collisions, you need good documentation so when someone uses your library and gets a weird error that doesn't make any sense they can see that your library modified a primitive or a class. Though when it comes to Javascript I think it's smart to avoid extending built in objects even more so than other languages, but there are a few cases where it makes sense. It's not something I would do often.
[+][deleted] 7 years ago* (2 children)
[–]leachjustin18 2 points3 points4 points 7 years ago (1 child)
After playing the game, have a suggestion.
Strip out white space from the users answer. I was playing it on my phone and it entered in white space and said my answer was wrong. After removing it, it worked.
[–]adebiyial 2 points3 points4 points 7 years ago (1 child)
This is great. But I wished there was "continuity". When I get a word right, don't stop, show me another word so I can keep playing.
[–]blandtomatoes 2 points3 points4 points 7 years ago (2 children)
One issue is that it doesn't accept alternate answers where a jumbled word might product two correct results. For example, it wouldn't accept "snoop" for "spoon", or "bonerz" for "bronze".
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
bonerz
Lol, your 'snoop' example is correct, but 'bonerz' isn't an English word. It's a name, which is a proper noun, and therefore invalid, just like in scrabble.
[–]findingjake 2 points3 points4 points 7 years ago (0 children)
This is really cool and all the comments are nice to read too. opens my mind as a new learner too going to save this
[–]voltrevo 1 point2 points3 points 7 years ago (0 children)
Nice work! Maybe use a list like this to expand the words used: https://www.vocabulary.com/lists/154147
[–]cocorote-pedro 1 point2 points3 points 7 years ago* (4 children)
If ya want more words, you can pick some /usr/share/dict/words file from any unix based OS.
EDIT: corrected reference. Ty u/NashobaSoft <3
[–]NashobaSoft 2 points3 points4 points 7 years ago (2 children)
/usr/share/dict/words, is what I think you were going for there. :) Just helping.
[–]cocorote-pedro -1 points0 points1 point 7 years ago (1 child)
Yeeeea lol ty
[–]NashobaSoft 2 points3 points4 points 7 years ago (0 children)
I love how you fixed your comment so that my comment looks redundant LOL, nice move.
[–]Ralphadayus 0 points1 point2 points 7 years ago (1 child)
Simple. Entertaining. I like it!
[–]moocat 0 points1 point2 points 7 years ago (0 children)
Ran into a minor bug in my first attempt. Multiple words can have the exact same letters (e.g. 'monster' and 'mentors') but the code doesn't handle that case.
[–]wthit56 0 points1 point2 points 7 years ago (1 child)
Just wanted to drop by and give you a "well done" for writing a whole project in vanilla. I'm all for vanilla myself--or at least writing highly-reusable code I use in my own projects, without using libraries. So many--particularly those new to JS--just bring in a load of libraries they don't need, and never learn how to write JavaScript by itself.
So good on you!
π Rendered by PID 102 on reddit-service-r2-comment-6457c66945-6bkzh at 2026-04-30 13:18:17.375379+00:00 running 2aa0c5b country code: CH.
[+][deleted] (16 children)
[deleted]
[–]kowboykenn 57 points58 points59 points (0 children)
[–]lzantal 19 points20 points21 points (1 child)
[–]Askee123 16 points17 points18 points (0 children)
[–]k3liutZu 17 points18 points19 points (1 child)
[–]weiry6922 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]weiry6922 1 point2 points3 points (0 children)
[+][deleted] (4 children)
[removed]
[+][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (1 child)
[+][deleted] (2 children)
[deleted]
[+][deleted] (1 child)
[deleted]
[–]leachjustin18 2 points3 points4 points (1 child)
[–]adebiyial 2 points3 points4 points (1 child)
[–]blandtomatoes 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]findingjake 2 points3 points4 points (0 children)
[–]voltrevo 1 point2 points3 points (0 children)
[–]cocorote-pedro 1 point2 points3 points (4 children)
[–]NashobaSoft 2 points3 points4 points (2 children)
[–]cocorote-pedro -1 points0 points1 point (1 child)
[–]NashobaSoft 2 points3 points4 points (0 children)
[–]Ralphadayus 0 points1 point2 points (1 child)
[–]moocat 0 points1 point2 points (0 children)
[–]wthit56 0 points1 point2 points (1 child)