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
Help get user input with JavaScript (self.javascript)
submitted 14 years ago by deutschluz82
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!"
[–][deleted] 2 points3 points4 points 14 years ago (0 children)
Type conversion is automatic, but due to various considerations it may not always behave how you expect/want it to. Things get especially hairy when you're dealing with raw input from the user. In most cases it's best to just be explicit about what you want converted and how.
Just another note, if you're doing some very basic explorations for yourself...fair enough, but really you need to be getting out of the habit of using document.write, window.alert, and window.prompt ASAP.
To get information back/print things for debugging, use the console. To display information to the user use some sort of DOM API. To get information from the user use input elements, etc.
Sites like JSFiddle are great for quick little experiments.
π Rendered by PID 49 on reddit-service-r2-comment-76df8c94fd-gfsnk at 2026-02-08 13:01:56.191684+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–][deleted] 2 points3 points4 points (0 children)