Skip to content

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.

2 participants