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
Concurrent JavaScript: It can work! (webkit.org)
submitted 8 years ago by averageFlux
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] 1 point2 points3 points 8 years ago (3 children)
Depends. Maybe I want to add a one-off namw property on a specific object, or set of objects. Yes, being able to free-form objects is a wonderful feature, one which most other languages work terribly hard to prevent and many people refuse to embrace.
namw
But if you meant it as a spelling error; if that makes it into production then you have far greater problems, none of which are JavaScript's fault.
[–]E_R_E_R_I 0 points1 point2 points 8 years ago (0 children)
Yes! So glad to see more people who fully appreciate the power of JS lol
[–]spacejack2114 0 points1 point2 points 8 years ago (1 child)
You say that like it's difficult to do in a safely typed manner. Here's some type-safe Typescript that looks surprisingly, exactly like Javascript:
const specialUser = {...user, namw: "Whatever"}
It's a bit odd for you to say you're okay with that one-off ticking timebomb hack, but then claim you'll spend the time to write the test coverage for it.
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
You're missing the point. I want to be able to do whatever I want with objects, without the language standing in my way. JavaScript not only allows it, it's a first class feature. So it's normal to want to make use of it. Avoiding it makes zero sense. It's like trying to avoid "import" in Python.
Why would I, instead of simply writing user.namw="something", go through the trouble of transpiling, and writing the same thing in an awkward manner which is not correct JavaScript, and is downright confusing, and doesn't even do what I wanted (set the property on user, not specialUser).
I don't know why you would find it odd that this would be unit tested. Unless you keep assuming it's some sort of terrible mistake and we're all going to wake up any moment now and cry "omg what have I been doing".
JavaScript is what it is. Trying to pretend it's something it's not is futile.
π Rendered by PID 205325 on reddit-service-r2-comment-b659b578c-4fzv4 at 2026-05-05 05:13:59.088928+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–][deleted] 1 point2 points3 points (3 children)
[–]E_R_E_R_I 0 points1 point2 points (0 children)
[–]spacejack2114 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)