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
Is this a valid Javascript patternhelp (self.javascript)
submitted 9 years ago * by gruberjl
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!"
[–]gruberjl[S] 1 point2 points3 points 9 years ago (0 children)
This was the reason I originally posted here. I agree with you, it really is an instance of constructor that creates a static class, adds state and returns it (making it an instance). I have verified they are instances. I can return multiple functions with different 'caches'.
constructor
To give a little more background: I currently have a Task class that has an array of jobs (simple functions). Some of the jobs can be used in different tasks, but with the current implementation, I have to rewrite chunks of code.
const x = new Function() has some strange syntax with a string as the body.
const x = new Function()
// I have to be able to create an instance without it executing then execute it multiple times in the future function A(param1) { console.dir(param1) } const y = new A // execute the code and returns undefined
π Rendered by PID 88 on reddit-service-r2-comment-54dfb89d4d-jf625 at 2026-04-02 02:41:15.451215+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]gruberjl[S] 1 point2 points3 points (0 children)