r/learnjavascript • • Jul 11 '21

My first javascript project

This is my first front-end/design project, it's game called Hangman built with vanilla javascript, html, css and illustrator for the design.

It's my first attempt to try and learn the javascript language, please support the project if you like it.

Link to the github repo with a demo: Hangman.

177 Upvotes

50 comments sorted by

View all comments

2

u/machine3lf Jul 11 '21

Great work! Haven’t looked into the code too deeply yet, but one quick suggestion, keep your indents at 2 or 4 spaces. Seems like all your indents are 8 spaces.

1

u/Am_abdou Jul 11 '21

Thanks man! Thank you for the suggestion, my indent is setup to 4 spaces in vs code

3

u/machine3lf Jul 11 '21

Somewhere, maybe in github or maybe in vscode, you have indents displaying as 8 spaces.

Also, you are using indent characters instead of spaces for your tabs,

There is an old debate about whether spaces or tab characters are better for indents. (I prefer spaces, fwiw). Regardless of which side you may come down on that, because you are using a single tab character, it's getting rendered as 8 spaces in github for some reason, which pushes your code out pretty far to the right.

https://coderwall.com/p/k1ighg/change-tab-size-on-github

1

u/Am_abdou Jul 12 '21

Thanks man, I'll check out the issue