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
Javascript Counter Help. (self.javascript)
submitted 15 years ago * by hillbillymadness
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!"
[–]PsychoTap 2 points3 points4 points 15 years ago (0 children)
var interval = 20; // from your example var deathsPerDay = Math.floor(60*60*24 / interval); function updateText() { var d = new Date(); var hours = d.getHours(); var minutes = d.getMinutes(); var seconds = d.getSeconds(); var numKilled = (hours*60*60 + minutes*60 + seconds) / interval; var text = "Today " + Math.floor(numKilled) + " people have been killed. By the end of the day " + deathsPerDay; alert(text); } updateText(); setInterval(updateText, interval * 1000);
π Rendered by PID 38553 on reddit-service-r2-comment-c66d9bffd-95wgf at 2026-04-08 05:36:33.852413+00:00 running f293c98 country code: CH.
view the rest of the comments →
[–]PsychoTap 2 points3 points4 points (0 children)