Closed shshaw closed 7 years ago
There's no such thing as formal deprecation in this respect. Informal deprecation means influential developers telling others "stop using it", which has been pretty common in my observation. However, it'll never be actually removed from JS.
The evidence for informal deprecation of arguments
includes the fact that its behavior was altered in strict mode (of ES5) to not be bound to its corresponding named arguments, as well as the fact that in ES6 the ...
rest operator obviates most common needs for arguments
. Moreover, arguments
being "array-like" instead of a real array has been the extremely common footgun that trips up devs for so many years, which is why it's so often frowned upon.
Ah, thanks for explaining.
Perhaps rephrasing that in the chapter would make that clearer:
With the addition of the rest operator (
...
) in ES5, it's strongly suggested that you avoid using thearguments
object whenever possible to avoid many complications that it can introduce.
In chapter 2, you state
As of ES5, arguments is deprecated.
, but from the information I can find, thearguments
object itself is not deprecated, but rather the propertyFunction.arguments
is.MDN's recommendation from Deprecated and Obsolete Features is:
If I'm mistaken, do you have any resources showing the deprecation of the
arguments
object?