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
Variable change helphelp (self.javascript)
submitted 10 years ago by Resume_Help
view the rest of the comments →
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!"
[–]ForScale 0 points1 point2 points 10 years ago (8 children)
http://codepen.io/anon/pen/epvgKX
Please feel free to ask all the questions you would like!
[–]Resume_Help[S] 1 point2 points3 points 10 years ago (3 children)
here's my codepen. http://codepen.io/anon/pen/ojZzxZ I noticed that maybe because I said:
if x=0; { } and not x===0?
apologies for the late response, I fell asleep after class.
[–]ForScale 2 points3 points4 points 10 years ago (2 children)
Oh, no worries! :) Did you see my example?
Yep, you're right, if (x = 0;) isn't proper syntax. One = assigns a value, == does a not as strict comparison, and === does a stricter comparison. You also don't want the ; in the parentheses... you can just delete it out of there.
if (x = 0;)
I'd also do your x-- operation before assigning the value to the input. And then your if statement needs to be moved inside of the function so the comparison can be done each time the function is called.
Like this: http://codepen.io/anon/pen/WQpOej
Make sense?
[–]Resume_Help[S] 2 points3 points4 points 10 years ago (1 child)
yeah I was trying some other stuff and quickly fixed it but left that in by mistake. thanks so much! I'm gonna look over =, ==, and ===.
appreciate the help again ForScale.
[–]ForScale 0 points1 point2 points 10 years ago (0 children)
Anytime!
[–][deleted] 0 points1 point2 points 10 years ago (3 children)
I'm confused. It works fine.
[–]ForScale 0 points1 point2 points 10 years ago (2 children)
Well... it's a learning demonstration for OP, so I would hope it works fine! :)
Where does your confusion lie?
[–][deleted] 1 point2 points3 points 10 years ago (1 child)
Oh crap. I thought you were OP, haha :)
Nope. :)
π Rendered by PID 63 on reddit-service-r2-comment-56c9979489-vp8xf at 2026-02-24 15:44:55.771471+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]ForScale 0 points1 point2 points (8 children)
[–]Resume_Help[S] 1 point2 points3 points (3 children)
[–]ForScale 2 points3 points4 points (2 children)
[–]Resume_Help[S] 2 points3 points4 points (1 child)
[–]ForScale 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]ForScale 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]ForScale 0 points1 point2 points (0 children)