Meta-programming JavaScript Using Proxies
dzautner.com
dzautner.com
If you're interested in seeing which browsers have implemented these ES6 features, Kangax has a nice table up on GitHub pages [3].
[1] https://developer.mozilla.org/en-US/docs/Archive/Web/Old_Pro...
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
†: Since Firefox 18 according to the MDN: https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...
It's fun to play with but for actual work a clear, strongly defined API beats this sort of syntactic sugar like this any day.
Also, I have some concerns over their performance but we will see in time.
At the same time, I'm also very scared to see what kind of crazy code this will lead to that I'd have to look at. I think lots of people will probably implement overly complex or obtuse ideas because they are interesting.
Here is original: http://tympanus.net/Development/AnimatedHeaderBackgrounds/
I'm currently working on a data persistence module with database backend in Node.js using Object.defineProperty that define get and set.
So then I go here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... and realize that it's an experimental proprosal for ES6, which means it's going to be a while before I can even think about using this. Then I realize the MDN article actually explained proxies and what they're designed for way better than this article (they're meant as a functional hook when manipulating properties on an object). It has useful, non-contrived examples that illustrate better than this article why you'd want this in the spec.
Regardless, it doesn't matter what language version it's in. What matters is that it's already implemented in Firefox and the IE previews.
The article could use some better structuring, but it does contain some interesting ideas for using proxies.