MCPcopy Create free account
hub / github.com/BorisMoore/jquery-tmpl / diff

Function diff

tests/qunit.js:822–834  ·  view source on GitHub ↗
( a, b )

Source from the content-addressed store, hash-verified

820
821// returns a new Array with the elements that are in a but not in b
822function diff( a, b ) {
823 var result = a.slice();
824 for ( var i = 0; i < result.length; i++ ) {
825 for ( var j = 0; j < b.length; j++ ) {
826 if ( result[i] === b[j] ) {
827 result.splice(i, 1);
828 i--;
829 break;
830 }
831 }
832 }
833 return result;
834}
835
836function fail(message, exception, callback) {
837 if ( typeof console !== "undefined" && console.error && console.warn ) {

Callers 2

checkPollutionFunction · 0.85
qunit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected