Below code returns the 'not' of two lists arrays :
var original = "test1,test2,test3"
var updated = "test1,test2,test4,test5"
var originalArray = original.split(',');
var updatedArray = updated.split(',');
console.log(originalArray.length)
console.log(updatedArray.length)
console.log($(originalArray).not(updatedArray))
console.log($(updatedArray).not(originalArray))
fiddle : http://jsfiddle.net/zhHfG/8/
The value of console.log($(updatedArray).not(originalArray))
is :
["test4", "test5", prevObject: jQuery.fn.jQuery.init[4], context: undefined, selector: ".not(test1,test2,test3)", constructor: function, init: function…]
How can the values "test4", "test5" be accessed ?
I could access them using array accessors [0],[1] but is there a cleaner way since the amount of returned values is variable ?