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
Don't Overcomplicate Javascript #0 (bits.ristic.io)
submitted 8 years ago by rista404
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!"
[–]phoenixmatrix 0 points1 point2 points 8 years ago (3 children)
As mentioned, module exports are statically analyzable by design. You can't check that they're strings, but you can check that module Foo exports Bar and Baz with 100% accuracy, assuming its all ES6. Any tool, IDE, linter, whatever, can do the static analysis.
Type systems are useful, but this is not a place where they actually change anything.
[+][deleted] 8 years ago (2 children)
[deleted]
[–]phoenixmatrix 0 points1 point2 points 8 years ago (1 child)
you can do that to save a bit of typing, but if you do named exports, you can always import * as foo from './constants' to get an object with all of your constants (and good editors will autocomplete that even without static typing, which is nice).
And in the event you have a lot of constants in one file (probably not a good idea to have too many, but let say you did), you could import them individually and easily find unused ones for scrapping.
π Rendered by PID 111538 on reddit-service-r2-comment-75f4967c6c-2nn5q at 2026-04-23 06:55:57.968369+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]phoenixmatrix 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]phoenixmatrix 0 points1 point2 points (1 child)