Guest User

Untitled

a guest
Nov 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. diff( [1, 2, 3, 4], [2, 3, 4, 5] );
  2. // => [ { action: 'delete', value: 1 },
  3. // { action: 'keep', value: 2 },
  4. // { action: 'keep', value: 3 },
  5. // { action: 'keep', value: 4 },
  6. // { action: 'insert', value: 5 } ]
  7.  
  8. diff( [1, 2, 3], [1, 5, 3] );
  9. // => [ { action: 'keep', value: 1 },
  10. // { action: 'change', value: 5, previous: 2 },
  11. // { action: 'keep', value: 3 } ]
Add Comment
Please, Sign In to add comment