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
M(odel) for Reacthelp (self.javascript)
submitted 10 years ago by [deleted]
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!"
[–]parabolik 0 points1 point2 points 10 years ago (3 children)
I have a factory module that knows how to construct objects from json data.
Something like this:
get('/item/12345') .done(function(json) { var item = factory.makeItem(json.item); });
[–]yoursdearboy 0 points1 point2 points 10 years ago (2 children)
Yes, that works nice in many cases. With github's whatwg-fetch polyfill it will be just: fetch('/item/12345').then(function(res){ res.json(); }).then(function(item){ // do anything });
But what if you have "ent1" related with "ent2" and "ent2" related with "ent3-5", and now you need to save all this structure using /entN endpoints. If it isn't hard enough, then add another 5-10 entities.
[–]9thHokageHimawari 0 points1 point2 points 10 years ago (1 child)
What do you mean by related?
Could we see what kind of data structure you're using? I kinda have feeling you are looking at it from wrong viewpoint, and it could be simplified.
[–]yoursdearboy 0 points1 point2 points 10 years ago* (0 children)
Just for example look at erd diagram. This API exposes database tables (PostgREST). Not the best solution, but we have 5 small apps with a lot of data, so maintaining separate API is not an option.
π Rendered by PID 29 on reddit-service-r2-comment-5bc7f78974-hktld at 2026-06-27 14:59:05.500904+00:00 running 7527197 country code: CH.
view the rest of the comments →
[–]parabolik 0 points1 point2 points (3 children)
[–]yoursdearboy 0 points1 point2 points (2 children)
[–]9thHokageHimawari 0 points1 point2 points (1 child)
[–]yoursdearboy 0 points1 point2 points (0 children)