In this specific case, I would have rejected the edit since the link is an aside and it isn't clear which part of a very long document is relevant to the answer. In general, adding links to posts with an edit should be evaluated by simply asking:
Does it make the post better?
For instance, in your post you say:
Which explains what you're getting, you're overriding the function. More generally, multiple var
declarations are allowed in JavaScript - var x = 3; var x = 5
is perfectly legal. In the new ECMAScript 6 standard, let
statements forbid this as well as normal var
statements in ES5 strict mode.
This could be improved as follows:
Which explains what you're getting, you're overriding the function. More generally, multiple var
declarations are allowed in JavaScript - var x = 3; var x = 5
is perfectly legal. In the new ECMAScript 6 standard, let
statements forbid this as well as normal var
statements in ES5 strict mode.
Adding a link to the specifications you are discussing allows people to look in to it if they want. It does not change your intent, the info is directly related to what you're talking about, and it saves me from doing a google search.
It could be further improved as:
Which explains what you're getting, you're overriding the function. More generally, multiple var
declarations are allowed in JavaScript - var x = 3; var x = 5
is perfectly legal. In the new ECMAScript 6 standard, let
statements forbid this as well as normal var
statements in ES5 strict mode.
The identifiers implements
, interface
, let
, package
, private
, protected
, public
, static
, and yield
are classified as FutureReservedWord
tokens within strict mode code. (11.6.2.2).
(assuming that's actually the relevant bit from the specifications that explains why, I personally don't know, so I won't suggest the edit). This not only adds a link to the information, but provides the context rather than just hiding it behind a link to a giant document.
Remember what the edit help says:
When should I edit posts?
Edits are expected to be substantial and to leave the post better than
you found it. Common reasons for edits include:
- To fix grammar and spelling mistakes
- To clarify the meaning of the post (without changing that meaning)
- To include additional information only found in comments, so all of the information relevant to the post is contained in one place
- To correct minor mistakes or add updates as the post ages
- To add related resources or hyperlinks
Adding resources is specifically listed as a reason to edit posts, so long as it is substantial and makes the post better.