/ Published in: JavaScript
URL: http://jsfromhell.com/array/diff
Compares two arrays and returns the distinct values. Created: 2005.11.04
Expand |
Embed | Plain Text
/* ************************************** * diff Function v1.0 * * Autor: Carlos R. L. Rodrigues * ************************************** */ diff = function(v, c, m){ var d = [], e = -1, h, i, j, k; for(i = c.length, k = v.length; i--;){ for(j = k; j && (h = c[i] !== v[--j]);); h && (d[++e] = m ? i : c[i]); } return d; };
You need to login to post a comment.
