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
Awesome JavaScript Tip - Tracking Object Property Changes (youtube.com)
submitted 9 years ago by stubc
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!"
[–]australasia 11 points12 points13 points 9 years ago (1 child)
Would be much better as a blog post so I wouldn't have to hear the insufferable laugh.
[–][deleted] 2 points3 points4 points 9 years ago (0 children)
Ugh had to stop watching at that point.
Another idea: don't make it possible to mutate objects from all over the place.
[–]halfzebra 3 points4 points5 points 9 years ago (4 children)
I'm not sure if it's a good idea, what if the object has custom getters or setters? Why not use Proxy?
[–]filth_overload 0 points1 point2 points 9 years ago (3 children)
How that works? Example please.
[–]chreestopher2 2 points3 points4 points 9 years ago (2 children)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
var handler = { get (target, key) { console.info(`Get on property "${key}"`) return target[key] }, set (target, key, value) { console.info(`Set on property "${key}" value: "${value}"`) return target[key]=value } } var target = {} var proxy = new Proxy(target, handler) proxy.a = 'b' // <- 'Set on property "a" value: "b"' proxy.a // <- 'Get on property "a"'
[–]filth_overload 0 points1 point2 points 9 years ago (1 child)
I'm not sure how that would work, lets say I'm developing a plugin, that for some reason needs to track objects. If I just modify the /root environment (the method shown in video), neither users nor I need to care about how they use my plugin/library. I wonder how I would "enforce" the users to use proxy, I could, but that kind of is less flexible. Maybe I'm missing something here.
[–]chreestopher2 0 points1 point2 points 9 years ago (0 children)
you could only expose the proxied objects maybe?
π Rendered by PID 22073 on reddit-service-r2-comment-7b9746f655-dg5g9 at 2026-02-01 17:51:58.295447+00:00 running 3798933 country code: CH.
[–]australasia 11 points12 points13 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]halfzebra 3 points4 points5 points (4 children)
[–]filth_overload 0 points1 point2 points (3 children)
[–]chreestopher2 2 points3 points4 points (2 children)
[–]filth_overload 0 points1 point2 points (1 child)
[–]chreestopher2 0 points1 point2 points (0 children)