Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Diff documentation #237

Merged
merged 3 commits into from Nov 12, 2020
Merged

Fix Diff documentation #237

merged 3 commits into from Nov 12, 2020

Conversation

dsnet
Copy link
Collaborator

@dsnet dsnet commented Oct 15, 2020

The description inaccurately describes the operation of Diff,
which is y - x, where a '+' prefix denotes elements added from y
and a '-' prefix denotes elements removed from x.

For example:

// Consider this call to Diff and its result.
                  x  y
cmp.Diff({b:2, c:3}, {a:1, b:2}) => {+a:1, b:2, -c:3}

// Consider the same in mathematical notation.
         y - x
{a:1, b:2} - {b:2, c:3} = {+a:1, b:2, -c:3}

The description inaccurately describes the operation of Diff,
which is y - x, where a '+' prefix denotes elements added from y
and a '-' prefix denotes elements removed from x.

For example:
	// Consider this call to Diff and its result.
	                  x  y
	cmp.Diff({b:2, c:3}, {a:1, b:2}) => {+a:1, b:2, -c:3}

	// Consider the same in mathematical notation.
	         y - x
	{a:1, b:2} - {b:2, c:3} = {+a:1, b:2, -c:3}
@dsnet dsnet requested a review from neild October 15, 2020 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants