Unexpected output error fixed in an example #42890
Merged
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I modified one line and added another line.
The incrementDay function was intended to return a Date instance, as stated in the inline JS comment; however, it just returns a Unix time number. My small fix is returning the Date instance instead of returning the return value of the setDate method of Date.
The current inline JS comment shows
2019-06-20as the return value of the function, despite the real output, on testing, would be Unix and, thus, something like1561006800.Motivation
This small intended improvement to the JS example is an opportunity to showcase my progress in the understanding and mastery of web technologies such as JavaScript, which will serve my professional career or even my personal satisfaction, because I will be able to display this as my accomplisment of contributing to MDN docs, which are an authoritative and prestigious source of information.
Additional details
Here is the link to the section of the page where the example is found.
Related issues and pull requests
There are no related issues or pull requests to this single line fix, as far as I know.