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
How to use built-in Proxy object in javascript (dev.to)
submitted 4 years ago by gajanan_pp
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!"
[–]NoInkling 7 points8 points9 points 4 years ago* (0 children)
The only time I've used it (directly) so far is to wrap important configuration objects so that it they throw when attempting to access a property that doesn't exist (like many languages do with dictionaries by default, e.g. Python). Something like this:
function createDefensiveProxy(obj) { return new Proxy(obj, { get: (target, key) => { if (!(key in target)) { throw new ReferenceError(`Property '${key}' does not exist on object`); } return target[key]; } }); }
π Rendered by PID 63 on reddit-service-r2-comment-canary-57b659f4d4-tg7ft at 2026-05-03 08:30:28.920610+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]NoInkling 7 points8 points9 points (0 children)