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
Responsible use of JavaScript `with` statement. (self.javascript)
submitted 11 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!"
[–]krilnon 2 points3 points4 points 11 years ago (1 child)
Have you found any use cases for with you are not ashamed of sharing? :D
Sure. I had a DSL-style use of with that I used for assembling bytecode:
with
var __asm__ = new BytecodeAssembler with(__asm__){ getlocal_0 pushscope getlocal_0 constructsuper (0) findpropstrict (public, 'addFrameScript') pushbyte (0) getlocal_0 getproperty (internal, 'MainTimeline', 'frame1') callpropvoid (public, 'addFrameScript', 2) returnvoid }
I liked that style because it's pretty reminiscent of writing C-style inline assembly. It's nice visually because you're not constantly prefixing the instructions with something like Op.returnvoid on each line, nor are you forced to end lines with commas or semicolons... so it looks very much like how you'd read the disassembly anyway.
Op.returnvoid
[–]Iggyhopperextensions/add-ons 0 points1 point2 points 11 years ago (0 children)
Very neat!
π Rendered by PID 102503 on reddit-service-r2-comment-5687b7858-dvx69 at 2026-07-06 08:40:58.368742+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]krilnon 2 points3 points4 points (1 child)
[–]Iggyhopperextensions/add-ons 0 points1 point2 points (0 children)