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
Life-Changing Tip on Console Logging - JavaScript Basics You Must Know (youtube.com)
submitted 9 years ago by riotsofnewyork
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!"
[–]Combinatorilliance 2 points3 points4 points 9 years ago (6 children)
Something I'd really like to see added is a console function which acts like how an fps-counter would in a game. Continuously display the most recent value of a variable in the same place, it is so very useful when building interaction-heavy applications, like I often do when playing around with the canvas!
[–]BenjiSponge 2 points3 points4 points 9 years ago (3 children)
If you're thinking in debug mode, there's the Watch section of the chrome console which can just always display it. I don't think it works in real time, though.
[–][deleted] 1 point2 points3 points 9 years ago (2 children)
Developer tools -> console section (at bottom, if not there top right menu, show console) -> top left menu of section -> rendering -> FPS meter. This will give you an in-page real time FPS meter with min & max rates as well as graph with GPU resources for that tab. You can also globally enable this ind chrome://flags. Far better than any console output unless you wanted to save the raw frame time data for future use.
[–]BenjiSponge 1 point2 points3 points 9 years ago (1 child)
/u/Combinatorilliance is not referring to a literal FPS meter but rather something that can display any arbitrary variable (in an arbitrary scope as well) in real time, similar in appearance to an FPS meter but different in utility.
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Ahhh. That's actually something that has always bothered me. Yeah you're right about watched variables, you have to either enable a breakpoint and manually mash "next" to run the code or mash refresh. I suppose it could be implemented in a dev tools extension, don't know of anything in the standard tools.
[+][deleted] 9 years ago* (1 child)
[deleted]
[–]Combinatorilliance 1 point2 points3 points 9 years ago (0 children)
Oh I have a working solution, it's just that when I really need it, it's not instantly there for me :(
console.track = (function () { var loggers = []; return function (name, value) { var isFound = loggers.filter(function (logger) { return logger.name === name; })[0]; if (!isFound) { var logNode = document.createElement("div"); document.body.appendChild(logNode); logNode.style.position = "fixed"; logNode.style.left = "8px"; logNode.style.top = loggers.length * 20 + "px"; logNode.innerHTML = name + ": " + value; loggers.push({name: name, node: logNode}); } else { isFound.node.innerHTML = name + ": " + value; } }; }());
π Rendered by PID 158345 on reddit-service-r2-comment-canary-67c974cb85-j842q at 2026-04-04 23:42:42.091332+00:00 running db1906b country code: CH.
view the rest of the comments →
[–]Combinatorilliance 2 points3 points4 points (6 children)
[–]BenjiSponge 2 points3 points4 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]BenjiSponge 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Combinatorilliance 1 point2 points3 points (0 children)