diff --git a/1-js/99-js-misc/01-proxy/article.md b/1-js/99-js-misc/01-proxy/article.md index 0ae375f7..8592ad7c 100644 --- a/1-js/99-js-misc/01-proxy/article.md +++ b/1-js/99-js-misc/01-proxy/article.md @@ -2,7 +2,7 @@ A `Proxy` object wraps another object and intercepts operations, like reading/writing properties and others, optionally handling them on its own, or transparently allowing the object to handle them. -Proxies are used in many libraries and some browser frameworks. We'll see many practical applications in this chapter. +Proxies are used in many libraries and some browser frameworks. We'll see many practical applications in this article. The syntax: @@ -244,7 +244,7 @@ If we forget to do it or return any falsy value, the operation triggers `TypeErr Such methods differ in details: - `Object.getOwnPropertyNames(obj)` returns non-symbol keys. - `Object.getOwnPropertySymbols(obj)` returns symbol keys. -- `Object.keys/values()` returns non-symbol keys/values with `enumerable` flag (property flags were explained in the chapter ). +- `Object.keys/values()` returns non-symbol keys/values with `enumerable` flag (property flags were explained in the article ). - `for..in` loops over non-symbol keys with `enumerable` flag, and also prototype keys. ...But all of them start with that list. @@ -446,14 +446,14 @@ Besides, an object may be proxied multiple times (multiple proxies may add diffe So, such a proxy shouldn't be used everywhere. ```smart header="Private properties of a class" -Modern JavaScript engines natively support private properties in classes, prefixed with `#`. They are described in the chapter . No proxies required. +Modern JavaScript engines natively support private properties in classes, prefixed with `#`. They are described in the article . No proxies required. Such properties have their own issues though. In particular, they are not inherited. ``` ## "In range" with "has" trap -Let's see more examples. +Let's see more examples.ar We have a range object: @@ -507,9 +507,9 @@ The `apply(target, thisArg, args)` trap handles calling a proxy as function: - `thisArg` is the value of `this`. - `args` is a list of arguments. -For example, let's recall `delay(f, ms)` decorator, that we did in the chapter . +For example, let's recall `delay(f, ms)` decorator, that we did in the article . -In that chapter we did it without proxies. A call to `delay(f, ms)` returned a function that forwards all calls to `f` after `ms` milliseconds. +In that article we did it without proxies. A call to `delay(f, ms)` returned a function that forwards all calls to `f` after `ms` milliseconds. Here's the previous, function-based implementation: @@ -587,7 +587,7 @@ The result is the same, but now not only calls, but all operations on the proxy We've got a "richer" wrapper. -Other traps exist: the full list is in the beginning of this chapter. Their usage pattern is similar to the above. +Other traps exist: the full list is in the beginning of this article. Their usage pattern is similar to the above. ## Reflect